Menu: clicking parent should only expand menu, not open page

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"
mvandek2
Forum Members
Forum Members
Posts: 39
Joined: Wed Apr 28, 2010 8:48 pm

Re: Menu: clicking parent should only expand menu, not open page

Post by mvandek2 »

I
- placed the code in the templates "home" and "standard"
- made the menu template "treeview"
- uploaded "jquery.treeview.min.js"and the folder "images" to "uploads/treeview"
- changed the "images/" path in "jquery.treeview.min.css" to "uploads/treeview" and applied this stylefile "treeview" to the templates "home" and "standard"

It seems to work with these remarks
- the homepage menu has a different styling, something is wrong there
- the active, collapsed menu shows an empty child on top

What is causing the styling is still unclear to me, is the cursive styling standard styling for second level list items that I should overrule?
Last edited by mvandek2 on Sun Jul 04, 2010 10:33 am, edited 1 time in total.
uniqu3

Re: Menu: clicking parent should only expand menu, not open page

Post by uniqu3 »

The problem on the start page is with:

Code: Select all

<div id="navigation">

Code: Select all

<div id="menu"><ul id="navigation">
The js code says:

Code: Select all

<__script__ type="text/javascript">
$(document).ready(function(){
	$("#navigation").treeview({
		collapsed: true,
		unique: true,
		persist: "location"
	});
});
</__script>
But if you have it defined 2x how should $("#navigation").treeview know to which to asign.
You could change in the MenuManager to and change $("#navigation").treeview to $("#mymenu").treeview

This should solve your start page problem.

Run you site threw validator http://validator.w3.org/check?verbose=1 ... %2Fprofiel

This can save you lots of trouble.
mvandek2
Forum Members
Forum Members
Posts: 39
Joined: Wed Apr 28, 2010 8:48 pm

Re: Menu: clicking parent should only expand menu, not open page

Post by mvandek2 »

It's the same for the other pages and there the menu behaves as it should.
I renamed the existing "navigation" in "nav", also no difference.

I also cannot identify what causes the empty top-child in the active menu.
So as soon as you click a child in a menu an empty child is addes at the top of the menu.
uniqu3

Re: Menu: clicking parent should only expand menu, not open page

Post by uniqu3 »

Try this menu template

Code: Select all

{if $count > 0}
<ul class="navigation">
{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><a href="{$node->url}" class="current"{if $node->target ne ""} target="{$node->target}"{/if}><span>{$node->menutext}</span></a>{elseif $node->parent == true && $node->depth == 1}
<li> <a href="{$node->url}" class="current"{if $node->target ne ""} target="{$node->target}"{/if}><span>{$node->menutext}</span></a>{elseif $node->type == 'sectionheader'}
<li>{$node->menutext}{elseif $node->type == 'separator'}<li>{else}
<li><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}><span>{$node->menutext}</span></a>{/if}{/foreach}{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
mvandek2
Forum Members
Forum Members
Posts: 39
Joined: Wed Apr 28, 2010 8:48 pm

Re: Menu: clicking parent should only expand menu, not open page

Post by mvandek2 »

OK, now they are the same on home and other pages, also no empty top child entry anymore.
Thanks, I am almost there!

It does not expand/collapse anymore and I need to style it, I applied jquery.treeview.css but it does not do anything.
Last edited by mvandek2 on Sun Jul 04, 2010 11:29 pm, edited 1 time in total.
uniqu3

Re: Menu: clicking parent should only expand menu, not open page

Post by uniqu3 »

Change Class="Navigation" to id="Navigation" in the Menu template
mvandek2
Forum Members
Forum Members
Posts: 39
Joined: Wed Apr 28, 2010 8:48 pm

Re: Menu: clicking parent should only expand menu, not open page

Post by mvandek2 »

Sorry, should have seen this one.
But the Home page (so Home template) does not respond to the style file.
uniqu3

Re: Menu: clicking parent should only expand menu, not open page

Post by uniqu3 »

do you use different page templates?
Try cleaning up the errors in your markup.
http://validator.w3.org/check?verbose=1 ... -pa.com%2F
mvandek2
Forum Members
Forum Members
Posts: 39
Joined: Wed Apr 28, 2010 8:48 pm

Re: Menu: clicking parent should only expand menu, not open page

Post by mvandek2 »

Yes, I have a differente template for the homepage, calls for the youtube and image gallery is only on the homepage.
The image gallery is the problem, when I remove {gallery} it seems to work.
I cannot target the problem in this module.

The menu is also pretty jumpy when opening pages, probably css issue?
uniqu3

Re: Menu: clicking parent should only expand menu, not open page

Post by uniqu3 »

Ok good you found the Problem, you removed Gallery from the start page so i can't take a look at it anymore.

The problem could either be somewhere same CSS id or class, or js for menu and gallery interfering each other.
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm

Re: Menu: clicking parent should only expand menu, not open page

Post by Jos »

which Gallery template did you use? probably one that calls the jQuery library also... Things can go wrong when jQuery gets called twice.
You could try to delete the jQuery call from the Gallery template and see what happens...
mvandek2
Forum Members
Forum Members
Posts: 39
Joined: Wed Apr 28, 2010 8:48 pm

Re: Menu: clicking parent should only expand menu, not open page

Post by mvandek2 »

Jos, you are right, thanks for that.
I think it is the default gallery "Gallery-1.3.2.xml" with "Fancybox" as the popup.
I replaced the Gallery and it seems OK.

Is the jumpiness of the menu a CSS matter?
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm

Re: Menu: clicking parent should only expand menu, not open page

Post by Jos »

For sure yes... probably has to do with positioning and dependancy of rendering the page by the browser. Not something i can help you with...
Post Reply

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