I am creating my menu using the mysource matrix code in the design file. I want to assign a unique ID to each top level list element so I am using the following piece of code:
The issue is that it is quite common for the folders that the li pulls the name data from are named/titled with more than one word, and in css this just won't work because of the inheritance principle. Is there another way to give a Squiz Matrix an alternate name where i can insert dashes/underscores to close up the spaces but still use the 'common name' for presentation at the front end of the website?
I.e. just like standard pages can have A Page Name and a Page Short Name
The reason I want to assign unique ID's to the elements is that I have a Javascript file that will perform some algorithms to target the specific IDs if certain conditions are met.
A better modifier might be css_safe, it may catch some of the edge cases better.From the manuals:
Returns a keyword string that is suitable for use as an HTML class or ID, which in turn can then be used as a CSS selector. Example: %asset_name^css_safe% Effect: 'Welcome to Squiz Matrix!' > 'Welcome_to_Squiz_Matrix'
And yes, it's amazing what you can get modifiers to do - and sometimes heartbreaking when they can't do the little things (especially when it *is* available but only in a version later than yours).