Problem with a menu

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
Hoppo88
New Member
New Member
Posts: 6
Joined: Fri Apr 15, 2011 10:42 pm

Problem with a menu

Post by Hoppo88 »

Hello all.

I have a slight problem with a menu system i am trying to build. Basically what i want it to look like is as follows
Image

with the main menutext being display in the captial letters at the top and an extra attribute added to each page displayed below.

I am having troubles getting it to display thou.

For each page i have set an extra attribute for what i would like to be displayed below and this can be shown using the code {page_attr key="extra1"}

However when i try to add this into my custom menu all the links have the same smaller text. FOr which page u are on it displays that extra value on every page. like so

Image

My menu code is

Code: Select all

{* CSS classes used in this template:
.activeparent - The top level parent when a child is the active/current page
li.active0n h3 - n is the depth/level of the node. To style the active page for each level separately. The active page is not clickable.
.clearfix - Used for the unclickable h3 to use the entire width of the li, just like the anchors. See the Tools stylesheet in the default CMSMS installation.
li.sectionheader h3 - To style section header
li.separator - To style the ruler for the separator *} 

{assign var='number_of_levels' value=10000}
{if isset($menuparams.number_of_levels)}
  {assign var='number_of_levels' value=$menuparams.number_of_levels}
{/if}

{if $count > 0}
<ul>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}

{if $node->parent == true or $node->current == true}
  {assign var='classes' value='menuactive'}
  {if $node->parent == true}
    {assign var='classes' value='menuactive menuparent'}
  {/if}
  {if $node->children_exist == true and $node->depth < $number_of_levels}
    {assign var='classes' value=$classes|cat:' parent'}
  {/if}
  <li class="{$classes}"><a class="{$classes}" href="{$node->url}">{$node->menutext}<span>{page_attr key="extra1"}</span></a>

{elseif $node->children_exist == true and $node->depth < $number_of_levels and $node->type != 'sectionheader' and $node->type != 'separator'}
<li class="parent"><a class="parent" href="{$node->url}">{$node->menutext}<span>{page_attr key="extra1"}</span></a>

{elseif $node->current == true}
<li class="currentpage"><h3>{$node->menutext}<span>{page_attr key="extra1"}</span></h3>

{elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext}<span>{page_attr key="extra1"}</span>

{elseif $node->type == 'separator'}
<li class="separator" style="list-style-type: none;"> <hr />

{else}
<li><a href="{$node->url}">{$node->menutext}<span>{page_attr key="extra1"}</span></a>

{/if}

{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
If i try to change <span>{page_attr key="extra1"}</span> to <span>{$node->page_attr key="extra1"}</span> nothing gets displayed

ANy help would be great !
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm
Location: the Netherlands

Re: Problem with a menu

Post by M@rtijn »

In the menu manager you'll find a modulehelp, where it says:

Code: Select all

{$node->extra1}
HTH ;)
Make your community a better place!
Post Reply

Return to “Layout and Design (CSS & HTML)”