Implementing a Custom Accordion Menu Navigation

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"
Locked
mrian

Implementing a Custom Accordion Menu Navigation

Post by mrian »

Hello,

I am running the CMS Made Simple 1.2.2. I am trying to modify the menu template to integrate an accordion menu. I appreciate any help/guidance/tips as I am new to CMS Made Simple. 

The current .tpl template file is as follows:

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
*} 


{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->current == true}
			<li class="currentpage">{$node->menutext}
		{elseif $node->parent == true}
			<li class="activeparent"><a class="activeparent" href="{$node->url}"
			{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}
			{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}
			{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}>
			{$node->menutext}</a>
		{elseif $node->type == 'sectionheader'}
			<li class="sectionheader">{$node->menutext}
		{elseif $node->type == 'separator'}
			<li class="separator" style="list-style-type: none;"> <hr />
		{else}
			<li><a href="{$node->url}"
			{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}
			{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}
			{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}
			{if $node->target != ''} target="{$node->target}"{/if}>
			{$node->menutext}</a>
		{/if}
	{/foreach}
	{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
The output of that .tpl template file is as follows:

Code: Select all

<div id="side_navigation">
  <ul>
    <!-- Parent -->
    <li class="currentpage">Parent 1
    <!-- Parent -->
    <li>      
      <a href="#">Parent 2</a>
      <!-- Start Children -->
      <ul>
        <li><a href="#">Child 1</a>
        <li><a href="#">Child 2</a>
        <li><a href="#">Child 3</a>
      </ul>
    <!-- End Children -->
    <!-- Parent -->
    <li><a href="#">Parent 3</a>
    <li>
      <!-- Start Parent -->
      <a href="#">Parent 4</a>
      <!-- Start Children -->
      <ul>
        <li><a href="#">Child 1</a>
        <li><a href="#">Child 2</a>
        <li><a href="#">Child 3</a>
      </ul>
      <!-- End Children -->
    </ul>
</div>
The desired output I am looking for is:

Code: Select all

<div class="toggle_controller"><h3>Parent 1</h3></div>
<div class="toggle_content">
  <ul>
    <li>Child node 1</li>
    <li>Chid node 2</li>
    <li>Child node 3</li>
  </ul>
</div>
<div class="toggle_controller"><h3>Parent 2</h3></div>
<div class="toggle_content">
  <ul>
    <li>Child node 1</li>
    <li>Chid node 2</li>
    <li>Child node 3</li>
  </ul>
</div>
Thank you very much for your help!
Last edited by mrian on Wed Dec 05, 2007 8:56 pm, edited 1 time in total.
savacom

Re: Implementing a Custom Accordion Menu Navigation

Post by savacom »

I'm looking for the same solution today, so please someone out there help, help, help!!!!!!!
cyberman

Re: Implementing a Custom Accordion Menu Navigation

Post by cyberman »

Have you make a look at MenuManagers help?
mrian

Re: Implementing a Custom Accordion Menu Navigation

Post by mrian »

cyberman wrote: Have you make a look at MenuManagers help?
Thanks for the reply. Yes, I checked the documentation and it doesn't address my question — The documentation simply outlines the properties available to the module. What I am seeking assistance with, in particular, is how to structure the Smarty syntax according to what I would like to accomplish.
cyberman

Re: Implementing a Custom Accordion Menu Navigation

Post by cyberman »

Not sure what you mean with accordeon menu (I'm not a native english speaker) but think maybe parameter collapse can help ...
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Implementing a Custom Accordion Menu Navigation

Post by Dr.CSS »

They want something where you click a title and child pages appear click next title and first collapses and next children appear...

Look in the hand book/wiki/documentation tab above under menu manager, there is one but I'm not sure it will collapse open items...
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Implementing a Custom Accordion Menu Navigation

Post by Dr.CSS »

OK I know this is an old post but here it goes, 2 collapse/accordion menus...

First one is not totaly driven by the menu manager template, it has 3 menu calls between the HTML tags that make it work...

http://multiintech.com/rounded/grey-slide.html&nbsp;   you click one of the first 3 gray areas, not the last one...

Second one is from dynamicdrive.com  and it is driven by the menu manager template, using section headers as clicking links and can have third level section headers that can click to open/expand more items and it remembers which one was open...

http://multiintech.com/squared/accordion-menu.html
Jevos
Forum Members
Forum Members
Posts: 25
Joined: Tue Jan 23, 2007 9:42 am

Re: Implementing a Custom Accordion Menu Navigation

Post by Jevos »

reviving an old post: the accordion solution is very nice... but: how do i implement this?

Jevos
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Implementing a Custom Accordion Menu Navigation

Post by Dr.CSS »

It's driven by the script form dynamicdrive.com and a custom menu template I made and all the gray click collapsing parts are section headers...
point4design
Forum Members
Forum Members
Posts: 68
Joined: Wed Aug 15, 2007 8:11 pm

Re: Implementing a Custom Accordion Menu Navigation

Post by point4design »

Dr. CSS wrote: It's driven by the script form dynamicdrive.com and a custom menu template I made and all the gray click collapsing parts are section headers...
I know this is an old topic, but I'm looking to do a similar menu. Would you be willing to share your custom menu template?
Locked

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