Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > First (and last) item in a Transformation View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
Nathoushka - 1/13/2011 9:32:41 AM
   
RE:First (and last) item in a Transformation
I am using Kentico 5.5 with an early december/late november hotfix (unknown version).

But I might have found why it was showing the error. I were not including the "#" in <%# ... %>. I am pretty sure that caused the error and I can't use my "if/else if/else" with it, so my question is:

How can I use the <%# ... %> for a if/else if/else?

User avatar
Certified Developer v7
Certified  Developer v7
Nathoushka - 1/19/2011 9:39:55 AM
   
RE:First (and last) item in a Transformation
I finally worked it out using:

<% if(DataItemIndex == 0) { %>
<li class="first">
<% } else { %>
<%# DataItemIndex == DataRowView.DataView.Count - 1 ? "<li class=\"last\">" : "<li>" %>
<% } %>
<a href="#">Go here</a></li>

Works perfectly.

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 2/7/2011 8:56:27 AM
   
RE:First (and last) item in a Transformation
Hi,

Thanks for sharing your solution here.

Regards,
Zdenek

User avatar
Member
Member
david.haigh-mercatosolutions - 2/12/2013 11:12:44 AM
   
RE:First (and last) item in a Transformation
Thanks Richard, that's exactly what I was looking for when I came to this thread.

1 2