Page 1 of 1

Struggling to make use of the built in menu

Posted: Mon May 17, 2010 2:26 pm
by luminous
I've got my main menu working now, but down the left hand side of each page I go to I would like a mini menu to display the immediate children for one level of navigation.  eg:

1.Products
1.1 Carbon
1.1.1 Bodybits
1.1.2 Spoliers
1.1.3 Tanks
1.2 Tuning
1.2.1 Filters
1.2.2 Exhausts

So the idea is that when you go to:

1 you see 1.1 and 1.2 only
1.1, you see a menu showing 1.1.1 , 1.1.2 and 1.1.3

Now I can do this by hand quite, easily, but I'd like to make a dynamic template that can do this for the whole site as its much larger than shown above.

So far I have got this:
{menu template="minimal_menu.tpl"  start_level="$node->depth" show_root_siblings="1" number_of_levels="1"}

If this would run, then it would show what I want.  Issue is that I cannot seem to import the depth of my node into the smarty code for calling the menu.  When I manually pop in a number into start_level I can get what I want, but would have to make a different template for each area of my site :(

Please point me in the right direction :)

Re: Struggling to make use of the built in menu

Posted: Tue May 18, 2010 9:59 pm
by luminous
Oh dear :(

I thought this question was going to be a really easy one.  I had presumed I had mixed up brackets, or had missed out a {literal} statement or something.  Looks like I will have to do it by hand until I work out a better way.

I'll just make a second editable region for pages that I can drop in the necessary code to make it work.

Re: Struggling to make use of the built in menu

Posted: Wed May 19, 2010 2:29 am
by jmcgin51
try

{menu template='minimal_menu.tpl'  start_level=$node->depth show_root_siblings='1' number_of_levels='1'}

Re: Struggling to make use of the built in menu

Posted: Wed May 19, 2010 3:18 am
by Dr.CSS
You could try start_level with {$page_alias} or {$friendly_position} which I believe will give you the 1.1.1 number/ID...

Re: Struggling to make use of the built in menu

Posted: Fri May 21, 2010 9:18 am
by luminous
Thanks for the suggestions, for some reason I did not get a mail to say there were replies.  I'll look into your ideas later, cannot do that atm :(

Re: Struggling to make use of the built in menu

Posted: Fri May 21, 2010 7:18 pm
by luminous
I've tried the above solutions, but unfortunately the menu function is not accepting those parameters.  I've tried a few others and so far the only workaround I am able to use is the collapse parameter.  While this is far from perfect, its better than nothing atm. 

I think I'll come back to this one later once I have sorted the myriad of other issues I seem to be finding.

Re: Struggling to make use of the built in menu

Posted: Fri May 21, 2010 7:56 pm
by Dr.CSS
I just tried page alias, I forgot it won't take it if it has {  } around it, but it does work, not sure if it does what you want but here it is, menu text page uses same template...

http://pat.multiintech.com/index.php?pa ... tylesheets

Re: Struggling to make use of the built in menu

Posted: Mon May 24, 2010 2:11 pm
by luminous
Thanks for trying to help me again.  I've done the following, and although it runs, it actually has no effect on the start level of the menu regardless where I am within my site:

{menu template="minimal_menu.tpl"  start_level=$page_alias number_of_levels='1'}

Eg, when I am on the Home page, it shows Home only, when I am the next level down, its still shows Home only.

If I remove the number of levels parameter it just shows the whole menu, all levels, all items regardless where I am in the site.

I'm glad my friend is understanding and is happy to wait while I learn this stuff!!

Re: Struggling to make use of the built in menu

Posted: Mon May 24, 2010 3:51 pm
by Dr.CSS
Maybe you mean something like this?...

http://multiintech.com/defaultcontent/d ... left.xhtml

Re: Struggling to make use of the built in menu

Posted: Mon May 24, 2010 5:30 pm
by gdur
Hi,

Have a look at this site http://www.duran-audio.com and let me know if this is what you are looking for. Took me a while to figure it out but finally it works for me.
Even when your in the lowest level it displays the sister pages with the parent page at the top. Have a play with it...
No problem to share the menu code even if it might be not as nice as could be.

Re: Struggling to make use of the built in menu

Posted: Tue May 25, 2010 4:40 pm
by luminous
Dr.CSS wrote: Maybe you mean something like this?...

http://multiintech.com/defaultcontent/d ... left.xhtml
Yes, that is basically what I am after, however I would like the start level to be dynamic.  When I am accessing a page that is at level 2, the following entry works wonderfully:

{menu template='simple_navigation.tpl' start_level='2' collapse='1'}

However, when I am at a page that is at level 3, I am after:
{menu template='simple_navigation.tpl' start_level='3' collapse='1'}

And then when I am at level 4:
{menu template='simple_navigation.tpl' start_level='4' collapse='1'}

My idea was to use one template for all these pages, and have something in the level area that would tell the menu manager what to do.  Or, failing that I was trying to write  my own menu template that could get the job done.

Re: Struggling to make use of the built in menu

Posted: Tue May 25, 2010 4:44 pm
by luminous
gdur wrote: Hi,

Have a look at this site http://www.duran-audio.com and let me know if this is what you are looking for. Took me a while to figure it out but finally it works for me.
Even when your in the lowest level it displays the sister pages with the parent page at the top. Have a play with it...
No problem to share the menu code even if it might be not as nice as could be.



That looks nice, but its hard to say if its what I am after.  Its starts out in the right way, but my site is 5 levels deep, so I would like the side menu just to show the immediate choices that the user has.

I may have to wait till I publish the site to show a link in order for you to see what I mean ;)

Oh, and your template is based on an Artisteer one?

Re: Struggling to make use of the built in menu

Posted: Tue May 25, 2010 6:52 pm
by gdur
Yes that's right, it's basicly created with Artisteer.
About the menu I don't think it matters how deep it is and I believe this is exactly offering the immediate choices. The tricky thing is what to offer when you're at the deepest level, nothing below that isn't it? What else could you do then offering the sister levels plus parent level? Deepest level nothing to collapse....haven't tried collapse -1 (minus 1) though but you could give it a try. It might do the math...

Re: Struggling to make use of the built in menu

Posted: Tue May 25, 2010 7:47 pm
by Dr.CSS
Putting all those menu calls would most likely get all levels at all time, so what you want is for the menu to only show the level you are on, how would you get to that level would it happen because you clicked a parent, say parent of 3rd level would make 4th level show?...

Re: Struggling to make use of the built in menu

Posted: Wed May 26, 2010 7:17 pm
by luminous
I think the only real way to show this will be with the actual site :)

The idea would be when you are at level 1 to see a sidemenu showing just the immediate children of level 1, which would take you to level 2.

Then at level 2 you would only see the children of that level, which would lead to level 3.

I'll.....I dunno what I'll do...  I'll try a few of the suggestion again above, then actually get the site up.  I can always ask for a hand tweaking a minor issue like that once its up.