Is it possible to add custom attributes to the html output of the nav()
helper (for example, to specify custom li
classes)?
http://omeka.org/codex/Functions/nav
Is it possible to add custom attributes to the html output of the nav()
helper (for example, to specify custom li
classes)?
http://omeka.org/codex/Functions/nav
Your input to nav can specify attributes, but only for the sub-navigation lists.
Exactly what kind of attributes were you trying to add to the output, something like the same class for every li
, or something that would vary between the list items?
For example, using the sample output from the documentation page, I wanted to take this:
<ul class="navigation">
<li class="nav-items current">
<a href="http://example.com/omeka/items">Items</a></li>
<li class="nav-exhibits">
<a href="http://example.com/omeka/exhibits">Exhibits</a></li>
</ul>
... and do something like this:
<ul class="navigation" data-role="listview" data-theme="g">
<li class="nav-items current ui-btn-current" data-role="page">
<a href="http://example.com/omeka/items">Items</a></li>
<li class="nav-exhibits" data-type="page">
<a href="http://example.com/omeka/exhibits">Exhibits</a></li>
</ul>
I'm not sure this is exactly what I was working on as I moved in a slightly different direction and forget some of the specifics, honestly.
But the general idea was to use some of the conventions from jQueryMobile to accomplish something within that framework. I just forget what it was at the moment.
I think this is another candidate for a total replacement of the function in your theme, unfortunately.
nav()
doesn't really have any entry points for outside code, apart from changing the nav elements themselves.