Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Auto Increment IDs in Transformations View modes: 
User avatar
Member
Member
ekeys-access - 7/20/2012 10:03:09 AM
   
Auto Increment IDs in Transformations
Is it possible to auto increment an element's ID within a transformation?

I am using a javascript plugin and a transformation that sets up the HTML structure needed for the plugin. I am going to have multiple instances of the plugin on the same page and would like each instance of the repeater's item template to be wrapped in a UL with a unique ID.

Thanks

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 7/20/2012 1:05:03 PM
   
RE:Auto Increment IDs in Transformations
can you just use the id of the dataitem in the repeater?

<ul id="<%#Eval("NodeID")%>">


Also, unless you are not using ASCX transformations, you can just give your ul an ID and set it to run at server. That way .Net will go ahead and take care of producing unique client ids.

<ul id="MyUl" runat="server">
</ul>

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 7/22/2012 9:20:45 PM
   
RE:Auto Increment IDs in Transformations
Hi,

additionally, in case you would like to generate ul li structure you can use css list menu web part and check its property Render item ID. It will generate unique IDs automatically.

Best regards,
Ivana Tomanickova