Page 2 of 2

Re: Sectionheader in menumanager

Posted: Wed May 17, 2006 4:56 am
by Elijah Lofgren
mark wrote: ok... do you think you could make one to spit out something like this....

...

i know i hate tables but it is a list/table of data... the JS that drives that other /old/ one is called out in tables if i could get my menu spit out this way....  OH YA

so you up for it? i would but i don't know how these 'loop'...  :(
Sure, I'm up for it. I think I'm addicted to making custom menu templates for people using the Menu manager  ;)
Instead of
I did:

Code: Select all

<tr><th class="tableh{table header number (a counter)}"> </th></tr>
which makes it more like: http://www.multiintech.com/old/index.html&nbsp; ;)

Here's the Menu Template (I named it "marks_menu_table"):

Code: Select all

{* CSS classes used in this template:
#active - The active/current page
hr.separator - To style the ruler for the separator
span.sectionheader - To style section header *}
{if $count > 0}
<table id="mainTable">
{foreach from=$nodelist item=node}
{if $depthcheck == 1 && $node->depth != $node->prevdepth}
{assign var="depth" value=$node->depth}
{assign var="depthcheck" value="0"}
{/if}
{if $node->depth != $depth && $collapseopened == 1}
</table></td></tr>

{assign var="collapseopened" value="0"}
{/if}
{if $node->current == true}
<tr><td><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a></tr></td>
{elseif $node->type == 'sectionheader'}
{assign var="depthcheck" value="1"}
{assign var="collapseopened" value="1"}
<tr><td><table>
{counter assign="table_num"}
<tr><th class="tableh{$table_num}"> </th></tr>
{else}
<tr><td><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a></tr></td>{/if}

{/foreach}
</table></td></tr>
</table>
{/if}
I call it in my template with this:

Code: Select all

{cms_module module='menumanager' template='marks_menu_table'}

Page structure I tested with:

Code: Select all

Title                                                  |  Type
Section Header                             Section Header 
        -   Home                                  Content
        -   Vertical (bulletmenu)       Content 
        -   One Content Column      Content 	
        -   Two Content Columns    Content 
2nd section header                      Section Header
        -   child 1                                 Content
        -   child 2                                 Content 
Here's the output I get (I shortened the URLs though):





Home
Vertical (bulletmenu)
One Content Column

Two Content Columns






child 1
child 2

I tried replacing the output of my menu template:

Code: Select all

<table id="mainTable">
...
</table>
with the the:

Code: Select all

<table id="mainTable">
...
</table>
on this page http://www.multiintech.com/old/index.html and it seemed to work!  :o  :)

Let me know how it goes.  ;)

Edit: removed extra ""

Re: Sectionheader in menumanager

Posted: Wed May 17, 2006 7:48 am
by nrkc
Cool, that works perfect! Now I only have a css problem (look www.capion.org) because the hole menu is in one , where it before were in two. But I think I will figure that out some day....

But thank you a lot for your help Elijah!

Re: Sectionheader in menumanager

Posted: Tue Dec 04, 2007 1:35 pm
by pimhd
It it possible to modify the section_expand menu so that an expanded section folds in again when you click on a next sectionheader?

Can someone help me with that?