[solved] custom menu with <p> inside?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
firfelin

[solved] custom menu with <p> inside?

Post by firfelin »

Hi,

I would like to have some kind of custom menu, with a descriptive text after the main menus and before the sub-category, something like:

Code: Select all

MENU 1.1
<p>
blablabla
etc
...
</p>

SUBMENU 1.1.1
SUBMENU  1.1.2
SUBMENU 1.1.3


MENU 1.2
<p>
blablabla
etc
...
</p>

SUBMENU 1.2.1
SUBMENU 1.2.2
SUBMENU 1.2.3
I dont understand menu template well enough to build something like: if hierarchy=1.1 put this text after li, if hierarchy=1.2 put this another text after li etc...

Is it possible?

Thanks a lot in advance for any help
Last edited by firfelin on Mon Aug 20, 2007 7:30 pm, edited 1 time in total.
cyberman

Re: custom menu with <p> inside?

Post by cyberman »

firfelin

Re: custom menu with <p> inside?

Post by firfelin »

thanks a lot for the tips :)

After some newb' ¿?@†aaaargh with the syntax, I've finally obtained what I wanted:

"my_menu":

Code: Select all

{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->depth == 1}
<li><a href="{$node->url}" {if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}</a><p>{$node->titleattribute}</p>


{elseif $node->current == true}
<li><a href="{$node->url}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}</a>
{else}
<li><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}</a>
{/if}

{/foreach}
and then i call it 3 times (I have some kind of "special" design...) in the page template with

Code: Select all

{menu template="my_menu" start_element="1.2"}
{menu template="my_menu" start_element="1.3"}
{menu template="my_menu" start_element="1.4"}
cyberman

Re: [solved] custom menu with <p> inside?

Post by cyberman »

Every call of menumanager eats a lot of performance and you call it three times :-\.

Change your template like this
{if $count > 0}

{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="" times=$node->depth-$node->prevdepth}
{elseif $node->depth prevdepth}
{repeat string="" times=$node->prevdepth-$node->depth}

{elseif $node->index > 0}
{/if}

{if $node->depth == 1}
url}" {if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}{if $node->titleattribute ne ""}{$node->titleattribute}{/if}


{elseif $node->current == true}
url}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}
{else}
url}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}
{/if}

{/foreach}
After that you need only one menu call if you add only content in title attribute for level 1.1, 1.2 and so other ;).
firfelin

Re: [solved] custom menu with <p> inside?

Post by firfelin »

...mmh

I think I dont have the choice... I have to call it three times, because the menu  is actually in three different separated  parts.
cyberman

Re: [solved] custom menu with <p> inside?

Post by cyberman »

Can you post a link?
firfelin

Re: [solved] custom menu with <p> inside?

Post by firfelin »

I have sended it by PM
cyberman

Re: [solved] custom menu with <p> inside?

Post by cyberman »

Got it.

It's only a question of CSS. Normally every is a block element which means a line break.

But if you set for the second level to an inline element it should be possible to get three columns :).
firfelin

Re: [solved] custom menu with <p> inside?

Post by firfelin »

I'll try;  thanks a lot for your help and advices ;D
Locked

Return to “CMSMS Core”