Menu with different id or class names on top nodes

Hi,


trying to code up a navigation that needs the following look: http://webserver.dkit.se/ra/





Is there any way to give the top nodes different id’s using the menu tags? If not any other solution?





/Daniel

[quote]Is there any way to give the top nodes different id’s using the menu tags? If not any other solution?
[right][post=“14454”]<{POST_SNAPBACK}>[/post][/right][/quote]



Sure, just used the asset ID of each node as the Div ID. Its always unique.

<MySource_PRINT var="assetid" /> outputs the assets id in the source. Use those id numbers in the CSS.


Remeber that id's can't start with an number to be valid html.

Also, if you don't want things like assetid's appearing in your css we have used the asset short name in the past. It puts limitations on what you can do with page heading's etc, but it can be quite useful.

Maybe a feature request on its way… :slight_smile:

[quote]Maybe a feature request on its way… :slight_smile:
[right][post=“14463”]<{POST_SNAPBACK}>[/post][/right][/quote]



make your id’s valid by putting a bit of text before your asset_id in the elements id attribute



eg:



id=“nav<MySource_PRINT var=‘assetid’ />”

yes, but what if a new asset is added? the css has to be updated as well. yes I know not a big issue. :wink:

[quote]yes, but what if a new asset is added? the css has to be updated as well. yes I know not a big issue. :wink:
[right][post=“14477”]<{POST_SNAPBACK}>[/post][/right][/quote]



Actually, this is why the CSS File asset was created. You can potentially use a menu design area in a CSS File asset to automatically create the CSS.



However, nowadays there are other, non-specific ways of achieving the same effect, which I would recommend. You don’t want to use generated CSS as it cannot be cached and will have serious impacts on performance.