Highlighting current page link

Hi,


Can anyone see any reason why the following wouldn't work? The current/notCurrent classes are already working with the top navigation in the design so the CSS is not the problem. I have used this successfully in a menu_normal, but this is the first time used in menu_stalks - maybe it doesn't work in menu_stalks?



[codebox] <ul>



<MySource_AREA id_name="left_nav" design_area="menu_stalks">

<Mysource_set name="settings.class.normal" value="notCurrent" />

<MySource_SET name="settings.class.current" value="current"/>

<Mysource_set name="settings.class.hierarchy" value="current"/>

<MySource_SET name="level" value="2" />

<MySource_SET name="min_num_levels" value="0" />

<MySource_SET name="max_num_levels" value="0" />

<MySource_SET name="alignment" value="left" />

<MySource_SET name="show_stalks" value="true" />

<MySource_SET name="indent" value="0" />

<MySource_SET name="min_height" value="25" />

<MySource_SET name="word_wrap" value="true" />

<MySource_SET name="ellipsis_length" value="0" />

<MySource_SET name="stalk_fg_colour" value="#000000" />

<MySource_SET name="stalk_bg_colour" value="#FFFFFF" />





<MySource_ASSET>

<li class="<MySource_PRINT var='settings.class' />">



<a href="<MySource_PRINT var='asset_link' />">

<MySource_PRINT var='asset_short_name' />

</a>



</li>

</MySource_ASSET>



<MySource_DIVIDER> <br /></MySource_DIVIDER>

</MySource_AREA>





</ul> [/codebox]



I should probably add that in the html output the class isn't printing: <li class="">

Hold the boat, it's OK, it does work with menu_stalks - silly old me, I had applied a customisation to this design area earlier when I was trying something and forgot to unapply it…all is good.


Thanks for reading…

Heh, its when you post it in public that the answer becomes clear. :slight_smile: Glad you worked it out.

Yeah I know!


Um, I am having a bit of trouble with my menu now though. For some reason my normal menu is outputting each line of the menu as a table. It's wierd as I have another normal menu on the page and it's not making tables. Why does it print tables and how do I stop it?



Do I have give it a position: absolute/relative or float it or something?





[codebox]<ul id="navLeftBody">



<MySource_AREA id_name="left_nav_links" design_area="menu_normal">

<Mysource_set name="settings.class.normal" value="notCurrentLeftNav" />

<MySource_SET name="settings.class.current" value="currentLeftNav"/>

<Mysource_set name="settings.class.hierarchy" value="currentLeftNav"/>

<MySource_SET name="level" value="2" />

<MySource_SET name="prefix_with_divider" value="false" />

<MySource_SET name="suffix_with_divider" value="false" />





<MySource_ASSET>

<li class="<MySource_PRINT var='settings.class' />">



<a href="<MySource_PRINT var='asset_link' />">

<MySource_PRINT var='asset_short_name' />

</a>



</li>

</MySource_ASSET>



<MySource_DIVIDER> <br /></MySource_DIVIDER>

</MySource_AREA>





</ul>



[/codebox]



and the output:



[codebox]<ul id="navLeftBody">

<div style="text-align: left;">

<table width="100%" cellspacing="0" cellpadding="0" border="0">

<tbody>

<tr>

<td class="notCurrentLeftNav" style="width: 100%; vertical-align: top; text-align: left;">

<li class="notCurrentLeftNav">

<a href="http://aklcms1.corrections.govt.nz/corrnet/about_us/community_assistance/corrections_in_the_community2/introduction"> Introduction </a>

</li>

</td>

</tr>

</tbody>

</table>

</div>



<div style="text-align: left;">

and so on down the list…[/codebox]

Sorry I've done it again, I deleted a menu_stalks customisation with the same area_id_name from the design and the table went away. Seems that menu_stalks use tables and somehow automatically customise themselves? So it was probably a hangover from when I had the menu_stalks menu in the design earlier. A bit of weirdness but once again all is good. Thanks:-)

Yes, I was going to reply, but I lost my mobile internet connection. :(’ /> If you change design area type, you must change the name of the design area as well. <img src=‘http://forums.matrix.squiz.net/public/style_emoticons/<#EMO_DIR#>/smile.gif’ class=‘bbc_emoticon’ alt=’:slight_smile: The stalks menu does use tables and is probably not terribly accessible (if that’s a concern for you). To create truly accessible menus, you need to use the normal menu.