Silly question, but is there a reason you don't want to use a simple list tag to emit the <ul>? There are million ways to add the 1,2,3 on the client side if you must.
Are you generating simple HTML, asp.net or something else? From: [email protected] [mailto:[email protected]] On Behalf Of Jian Huang Sent: Tuesday, 23 April 2013 12:10 PM To: [email protected] Cc: [email protected] Subject: Re: Modifying the <foreach> counter Ah, the grail of rendertag question. Type conversion. Store:counter is returned as Int32, but rendertag doesn't support arithmetic. If you do .ToString() and then see if then see if there are any functions in the String class that support anything or something that can further your need. In short, most likely no, there is one way I know, but it involves pseudo arithmetic using ifs and strings. Try preexecution? The other way is to use JQuery, way less clunky JavaScript. Sent from my iPhone On Apr 22, 2013, at 9:37 PM, [email protected] <mailto:[email protected]> wrote: Hi, everyone. I'm not very experienced in using the <foreach> but I've been able to get it to partially work for my needs. There is one minor remaining thing that I'm sure can be done cleaner but I'm not sure how to go about it. Basically, I trying to output the contents of a list Element as an unordered list items containing sequential links i.e.: <li><a class="" title="" href="">1</a></li> <li><a class="" title="" href="">2</a></li> etc. Here is what I have: <reddot:cms> <foreach itemname="item" object="Context:CurrentPage.GetElementByName(lst_feature).Value" countername="counter"> <htmltext> <li><a class="" title="<%!! Store:item.Headline !!%>" href="javascript:;"><script>document.write(<%!! Store:counter !!%> + 1);</script></a></li> </htmltext> </foreach> </reddot:cms> I don't like using the JavaScript there. Just seems really clunky. I'm sure there is a cleaner way to do this. Any wisdom is much appreciated. Thanks and regards, EMB -- You received this message because you are subscribed to the Google Groups "RedDot CMS Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]> . To post to this group, send email to [email protected] <mailto:[email protected]> . Visit this group at http://groups.google.com/group/reddot-cms-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "RedDot CMS Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]> . To post to this group, send email to [email protected] <mailto:[email protected]> . Visit this group at http://groups.google.com/group/reddot-cms-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "RedDot CMS Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/reddot-cms-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
