
Wouldn’t it make sense to use a different prefix for each menu instance on a page
e.g. IDs like "MYMENU1_" and "MYMENU2_" and then append a unique ID (row or page number etc) for each li in a menu?
Quote from: stewski at Aug 08, 2006, 06:49 AM
Wouldn’t it make sense to use a different prefix for each menu instance on a page
e.g. IDs like "MYMENU1_" and "MYMENU2_" and then append a unique ID (row or page number etc) for each li in a menu?
If you need to do this you can with wayfinder, all you need to do is change the &rowIdPrefix parameter for each snippet call

$getFields = 'id,menutitle,pagetitle,menuindex,published,hidemenu,parent,isfolder,description,alias,longtitle'; $resource = $modx->getActiveChildren($parentId,'menuindex','ASC',$getFields);
I am sorry that i have upset you so much.
I’m sure that there are uses for having each item have its own ID, particularly with javascript menus, and yes it could be useful to be able to ensure unique IDs - stewski’s method sounds good and similar to other menu routines I have encountered elsewhere.
There are many ways of achieving IDs with Wayfinder if one wants to. To clarify my point, people should only add IDs to things if that is going to be useful. IDs are not a requirement of CSS or HTML semantics.
To apply this false "unique=ID" logic to everything, you would give each paragraph its own ID because they said different things. And you would possibly have to mention every ID in your style sheet. It’s just a misunderstanding of "web standards", and I want to make it clear to everyone that Wayfinder’s default class-not-ID set up is not a "mistake" as FunkyBuddah puts it.
<ul>
<li id="current"><strong id="h">Home</strong></li>
<ul>
<li><a href="#"><span>Menu Item 1</span></a></li>
<li><a href="#"><span>Menu Item 2</span></a></li>
</ul>
<li[+wf.id+][+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]"><span>[+wf.linktext+]</span></a>[+wf.wrapper+]</li>
<!--[if lte IE 6]>
<style type="text/css" media="screen, tv, projection">
body { behavior: url(assets/js/csshover.htc); } /* hover:anything support */
</style>
<script type="text/javascript" src="assets/js/sleight.js"></script>
<![endif]-->This discussion is closed to further replies. Keep calm and carry on.