11 October 2007 at 2:42pm
yes each page has an ID attached to it. If you need a special ID for each menu item I use id="$URLSegment" so that will come up with an id of "home" or "contact-us". You can also you id="$ID" in your template and that will generate id="3" for whatever link but 3 is not as semantic and easy to understand as 'home'. The only problem with this method is that if you can the page url you will need to update the id name in the css
11 October 2007 at 6:37pm
You could also use something like <li class="item-$Pos"> which outputs <li class="item-1"> etc, dependent on what position it's in from the DataObjectSet you generated it from, typically using <% control Menu(1) %> or Menu(2).
$URLSegment is a good semantic way to use it. However, it's volatile as users could change the page name, which in turn updates the URL segment, as Will said.
Odd, I swear I tried $ID yesterday but it didn't work (I put it outside all the tags but within the control section...) , today I put it in properly as id="m$ID" within the tag and it worked like a charm! Great. Thanks guys.
I would advice though not to use URL segment for future reference because
a) id will become too long, for large sites this means a couple of kb more per view
b) as you said, url segment could change where as the ID won't