Struggling to make use of the built in menu

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
luminous
Forum Members
Forum Members
Posts: 168
Joined: Fri May 14, 2010 6:49 pm

Struggling to make use of the built in menu

Post 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 :)
Last edited by luminous on Mon May 17, 2010 2:51 pm, edited 1 time in total.
luminous
Forum Members
Forum Members
Posts: 168
Joined: Fri May 14, 2010 6:49 pm

Re: Struggling to make use of the built in menu

Post 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.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Struggling to make use of the built in menu

Post by jmcgin51 »

try

{menu template='minimal_menu.tpl'  start_level=$node->depth show_root_siblings='1' number_of_levels='1'}
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Struggling to make use of the built in menu

Post 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...
luminous
Forum Members
Forum Members
Posts: 168
Joined: Fri May 14, 2010 6:49 pm

Re: Struggling to make use of the built in menu

Post 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 :(
luminous
Forum Members
Forum Members
Posts: 168
Joined: Fri May 14, 2010 6:49 pm

Re: Struggling to make use of the built in menu

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Struggling to make use of the built in menu

Post 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
luminous
Forum Members
Forum Members
Posts: 168
Joined: Fri May 14, 2010 6:49 pm

Re: Struggling to make use of the built in menu

Post 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!!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Struggling to make use of the built in menu

Post by Dr.CSS »

Maybe you mean something like this?...

http://multiintech.com/defaultcontent/d ... left.xhtml
gdur
Forum Members
Forum Members
Posts: 142
Joined: Sun Jan 10, 2010 10:59 am

Re: Struggling to make use of the built in menu

Post 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.
luminous
Forum Members
Forum Members
Posts: 168
Joined: Fri May 14, 2010 6:49 pm

Re: Struggling to make use of the built in menu

Post 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.
luminous
Forum Members
Forum Members
Posts: 168
Joined: Fri May 14, 2010 6:49 pm

Re: Struggling to make use of the built in menu

Post 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?
gdur
Forum Members
Forum Members
Posts: 142
Joined: Sun Jan 10, 2010 10:59 am

Re: Struggling to make use of the built in menu

Post 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...
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Struggling to make use of the built in menu

Post 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?...
luminous
Forum Members
Forum Members
Posts: 168
Joined: Fri May 14, 2010 6:49 pm

Re: Struggling to make use of the built in menu

Post 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.
Post Reply

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