Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions

LinkingMode current and section


Reply

4 Posts   2133 Views

Avatar
moonchild100

28 May 2011 at 12:25pm (Last edited: 28 May 2011 12:28pm), Community Member, 18 Posts

In the following code, the <li> for level 2 will always be "current" even when I am in level 3 when the mode for level 2 parent menu should be "section" but it stays in current mode. However, if I go from level 3 to level 4, the menu of level 3 can show section and current two modes. I don't know why....maybe it's because menu(3) is using control menu while the level(2) are not?

to make it clearer, here's how the menu bar looks like: when you are in "level(3).title" the level(2).title shows class="current" other than class="section"
however, if like illustrated below you are in level(4), the level(3).title are in section mode

----------------------------------------
level(2).title | level(3).title | level(3).title
---------------|---------------|----------------
| level(4).title | level(4).title | level(4).title |

<ul>      
   <li class="$LinkingMode">
      <a href="$Level(2).Link" title="Go to the $Level(2).Title.XML page">
         <span>$Level(2).MenuTitle.XML</span>
      </a>
   </li>

   <% control Menu(3) %>   
         <li class="$LinkingMode">
            <a href="$Link" title="Go to the $Title.XML page">
               <span>$MenuTitle.XML</span>
            </a>
         </li>
   <% end_control %>
   
</ul>

Avatar
Willr

28 May 2011 at 6:38pm Forum Moderator, 5511 Posts

From looking at your example you're using Level(2) for level 2, but simply LinkingMode for the link mode. This will be simply using LinkingMode for the current page.

Try

<% control Level(2) %>
<ul>
<li class="$LinkingMode">
<a href="$Link" title="Go to the $Title.XML page">
<span>$MenuTitle.XML</span>
</a>
</li>

.. remainer of your controls.

Avatar
moonchild100

28 May 2011 at 8:18pm Community Member, 18 Posts

Thanks Willr, that works :)

so the linkingmode only works with page control not a simple link , right?

Avatar
Willr

29 May 2011 at 11:04am Forum Moderator, 5511 Posts

so the linkingmode only works with page control not a simple link , right?

No, linkingmode works everywhere, however in your example your LinkingMode was referring to the mode of the current page (which would always return current) as it wasn't nested inside any control. To get the correct level 2 menu status you had to be in the correct 'scope' of the Level(2) control.