[solved] Drop down menu issue!

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
YYYwebdesin
New Member
New Member
Posts: 4
Joined: Tue Oct 25, 2011 11:08 pm

[solved] Drop down menu issue!

Post by YYYwebdesin »

Hi guys, im running the latest cmsms on my xampp server and everything is working fine.

The problem I have is my menu, ive intgrated it into cmsms and it adds a new page in the menu when i create a new page which is fine.

The problem is that when I create a child page it doesnt show it in a drop down menu as it would do normally, it would just appear as another button under the parent button.

Im using the simple_navigation.tpl, don't know why, but its the only one that works.

Near the end bit of the tpl file I have this:

Code: Select all

{else}
<li><a href="{$node->url}"><span>{$node->menutext}</span></a>
Which generates the button ofcourse.. Now in my HTML I use this code to create the drop down button:

Code: Select all

<ul class="dropdown">
                <li><a href="#about/1">about this item</a></li>
            </ul>
I used that and added it to the line in the .tpl file so it looks like this:

Code: Select all

{else}
<li><a href="{$node->url}"><span>{$node->menutext}</span></a><ul class="dropdown">
                <li><a href="{$node->url}">{$node->menutext}</a></li>
            </ul>
This works and the drop down menu appears with all the css working fine. Although the problem still persists, say the child page is called 'test' and the parent is 'home' the 'test' page still appears under the parent 'home' although it does appear in the drop down menu also when hovering over the 'home' page.. Now I want to get rid of the one that is not in the drop down menu and appears under the parent page.

If anyone could help me I would highly appreciate it! I absolutey love cmsms but this is just letting me down. :(

I'm assuming this has something to do with the code in the simple_navigation.tpl file as my html and css work fine.
YYYwebdesin
New Member
New Member
Posts: 4
Joined: Tue Oct 25, 2011 11:08 pm

Re: Drop down menu issue!

Post by YYYwebdesin »

http://img1.uploadscreenshot.com/images ... 4-orig.jpg

Here is what it currently looks like

'Home' and 'How cmsms works' are both parent pages,

'Templates and stylesheets' is a child page to 'How cmsms works'

This is what happens after I hover after messing around with the .tpl file ive got to this:
http://img1.uploadscreenshot.com/images ... 6-orig.jpg

Now the drop down button is the one with the dark grey bg.. Thats what I want for when I add a child page to a parent. I want to get rid of the 'Templates and stylesheets' from the main bit of the navbar where the parent pages will be.

Here is the current tpl code:

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}" 
<a href="{$node->url}"><span>{$node->menutext}</span></a>

{elseif $node->children_exist == true and $node->depth < $number_of_levels }
<li class="parent"><a href="{$node->url}"><span>{$node->menutext}</span></a>

{elseif $node->current == true}


{elseif $node->type == 'sectionheader'}


{elseif $node->type == 'separator'}


{else}
<li class="parent"><a href="{$node->url}"><span>{$node->menutext}</span></a>
[color=#FF0000]<ul class="dropdown">
                <li><a href="{$node->url}">{$node->menutext}</a></li>
            </ul>[/color]


{/if}


{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
The bit in red is the html code for my drop down. Ive messed around and tried creating a custom tpl file but it just fails.

Please help! All I want is when I add a child page in the admin panel it automatically goes into a drop down menu under the parent page without the child page being displayed on the navbar.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Drop down menu issue!

Post by Dr.CSS »

That menu template isn't really set up for drop downs, that is why there is the cssmenu.tpl, use that and the right style sheet and you should get a menu like this...

http://multiintech.com/defaultcontent/d ... ontal.html
YYYwebdesin
New Member
New Member
Posts: 4
Joined: Tue Oct 25, 2011 11:08 pm

Re: Drop down menu issue!

Post by YYYwebdesin »

Ah! Thanks! Now to style it, if I have any problems i'll get back to you :)
YYYwebdesin
New Member
New Member
Posts: 4
Joined: Tue Oct 25, 2011 11:08 pm

Re: Drop down menu issue!

Post by YYYwebdesin »

Thanks a heap, works perfectly now. :D
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Drop down menu issue!

Post by Dr.CSS »

Post Reply

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