[SOLVED]Get menu to stop at given element

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
lena.pfaff
Forum Members
Forum Members
Posts: 24
Joined: Tue Feb 03, 2009 5:24 pm

[SOLVED]Get menu to stop at given element

Post by lena.pfaff »

Hi there

Now i really do need your help again

I have tried many many many things and read a lots of topic without any luck. :-[

I am using:
CMS Version 1.8
MenuManager 1.6.5

My menu could look like this:

Home
1.Dogs
     -1.1 Food
     -1.2 Coat

2.Cats
     -2.1 Food2
     -2.2 Coat2

3.Contact

In one menu I need to start at a given element.
That is NO problem:

I use the parametre: start_element="2"
Like this: {menu template='simple_navigation.tpl' start_element="2"}

But... In another menu I need to start and stop at a given element.
I have tried all the parametre in menu manager help, with out any luck.
I can't get it to stop, and still show the children of the elements I choose to show before I stop the menu!

Can someone help me

Thanz in advance

Pfaff
Last edited by lena.pfaff on Fri Oct 08, 2010 7:24 am, edited 1 time in total.
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: Get menu to stop at given element

Post by spcherub »

The are couple of things I would try but not knowing your exact requirements I'm not sure if they are applicable to your case or not. But here goes ...

If the ID or title of the page you want to stop at is known, you could add a check inside the foreach loop in the menu template and have it quit the loop at that point. Of course you will need to make sure that all list elements tags are closed etc. You can use either ID of page title or even menu title for this.

If you only need to support one of the menu at a time on a page, then you can simply unselect the show in menu option of the pages that you don't want to appear in the menu. This of course won't work if you have to support both types of menu you have listed in your post at the same time.

The third option is to use CGSimpleSmarty and write you own menu loop with start and stop conditions.

Hope that helps.

Sanjay
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Get menu to stop at given element

Post by Dr.CSS »

You need to show the whole menu structure and say what is to be shown and what is not to be shown and when these things are to occur...
lena.pfaff
Forum Members
Forum Members
Posts: 24
Joined: Tue Feb 03, 2009 5:24 pm

Re: Get menu to stop at given element

Post by lena.pfaff »

spcherub wrote: The are couple of things I would try but not knowing your exact requirements I'm not sure if they are applicable to your case or not. But here goes ...

If the ID or title of the page you want to stop at is known, you could add a check inside the foreach loop in the menu template and have it quit the loop at that point. Of course you will need to make sure that all list elements tags are closed etc. You can use either ID of page title or even menu title for this.

If you only need to support one of the menu at a time on a page, then you can simply unselect the show in menu option of the pages that you don't want to appear in the menu. This of course won't work if you have to support both types of menu you have listed in your post at the same time.

The third option is to use CGSimpleSmarty and write you own menu loop with start and stop conditions.

Hope that helps.

Sanjay
Hi Sanjay

Thank you so much for trying to help me. :)

But I must confess that my knowledge about the things that you wrote not is enough, to try out your suggestions.

I am just about to learn about php and javascript :P
I am learning every day, also from this forum.

This is the site that I need to change: www.abrahamsenhorse.dk

I have commented the 3 options from you

1) This I do not understand: "add a check inside the foreach loop"
2) I need to support both of them at the same time, so that is not an option
3) I have installed this: CGSimpleSmarty, but I do not know how to use it.

So as you can see I am fu... sorry my language

If you do´nt want to help such a newbie further, that is allright.
I know that I have a long way still to go.

Lena
lena.pfaff
Forum Members
Forum Members
Posts: 24
Joined: Tue Feb 03, 2009 5:24 pm

Re: Get menu to stop at given element

Post by lena.pfaff »

Dr.CSS wrote: You need to show the whole menu structure and say what is to be shown and what is not to be shown and when these things are to occur...
Hi Dr. CSS
Thank you also, for trying to help me. I really appreciate it.

I have attached a jpg of the menu structure... Will that do?

I need:
  • first menu to go from: element 2 to element 3.5.3
  • second menu to go from: element 4 to element 6.
Please let me know if this is not enough info

Regards Lena
Attachments
1.jpg
lena.pfaff
Forum Members
Forum Members
Posts: 24
Joined: Tue Feb 03, 2009 5:24 pm

Re:[SOLVED] Get menu to stop at given element

Post by lena.pfaff »

lena.pfaff wrote: Hi there

Now i really do need your help again

I have tried many many many things and read a lots of topic without any luck. :-[

I am using:
CMS Version 1.8
MenuManager 1.6.5

My menu could look like this:

Home
1.Dogs
      -1.1 Food
      -1.2 Coat

2.Cats
      -2.1 Food2
      -2.2 Coat2

3.Contact

In one menu I need to start at a given element.
That is NO problem:

I use the parametre: start_element="2"
Like this: {menu template='simple_navigation.tpl' start_element="2"}

But... In another menu I need to start and stop at a given element.
I have tried all the parametre in menu manager help, with out any luck.
I can't get it to stop, and still show the children of the elements I choose to show before I stop the menu!

Can someone help me

Thanz in advance

Pfaff
Hi again

With your help I just solved my problem.

I read some new topics and I found out that this help:

I use the parametre: excludeprefix

Thank you so much

Regards Lena
Post Reply

Return to “CMSMS Core”