Page 2 of 2

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

Posted: Sun Jul 04, 2010 9:52 am
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?

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

Posted: Sun Jul 04, 2010 11:29 am
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.

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

Posted: Sun Jul 04, 2010 9:12 pm
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.

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

Posted: Sun Jul 04, 2010 10:35 pm
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}

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

Posted: Sun Jul 04, 2010 11:25 pm
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.

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

Posted: Mon Jul 05, 2010 6:37 am
by uniqu3
Change Class="Navigation" to id="Navigation" in the Menu template

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

Posted: Mon Jul 05, 2010 8:34 am
by mvandek2
Sorry, should have seen this one.
But the Home page (so Home template) does not respond to the style file.

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

Posted: Mon Jul 05, 2010 9:41 am
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

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

Posted: Mon Jul 05, 2010 12:51 pm
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?

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

Posted: Mon Jul 05, 2010 12:57 pm
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.

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

Posted: Mon Jul 05, 2010 1:10 pm
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...

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

Posted: Mon Jul 05, 2010 1:42 pm
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?

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

Posted: Mon Jul 05, 2010 1:52 pm
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...