Display second level (drop-down) links independent of show_menu2

mdemaree99

What have you tried and results?

Can't reiterate more on checking out the examples and readme file.
Very specific examples and code that make this really easy.

specchild  (examples page)
Children of a specific page (page = Cogs)

show_menu2(0, 9, SM2_ALL, SM2_ALL); [page_id of Cogs is 9]

Specific page, only one level deep: (readme file)
show_menu2(1, 79, SM2_START+1, SM2_ALL|SM2_PRETTY);

Option is use droplets....
- write a droplet that lists the links and put droplet on each page.
- use  showmenu to just list the pages you need. (yes. if could do here.. template should work as well, but may be easier since the page is static)

Use the    [[showsection?section=75]] droplet on each page
Since page is static the showmenu will be the same each time.

Possibly able to use a droplet inside a template, or include a page. 
I haven't read about putting droplets in templates, but sounds feasible.
(worst case.. use code from the showsection droplet inside the template)





sky writer

I know this, but I want the children of one parent shown on all pages.  Other parents have children, and I don't want those shown on all pages.

So, my understanding and experience is that that SM2_ROOT+1 will show the children of all parent pages.  I do not want that.

mdemaree99

In my example... Vertical menu vs Show Child pages is one in the same when using showmenu.
Depending on how you code the CSS is how it will look.  It can be in a menu type setting or just links.

I Child pages are going to be SM2_CURR+1 or SM2_ROOT+1 as the starting point.
This can be done in the template of the page if you want it on all pages, or possibly in the code section of a page if you only want it to appear once.  Haven't tried this before, but should work.


sky writer

I am not sure of the specific needs of the original post, but my needs are not:
A vertical menu would appear on the ABOUT page listing
--- THE COMPANY
--- THE OWNER

I need to show the children of a certain page on ALL the pages.

mdemaree99

I didn't see the original questions, and not sure if I had the solution last September anyways, but getting deeper into WebsiteBaker and almost understand it.

Check out the show_menu readme file and examples page.
Tons of help on how to setup menus.

Readme
https://forum.WebsiteBaker.org/index.php/topic,23012.0.html

Examples (These have been the most useful for me, but still need to understand what each section means so you can modify the examples to fit your need).
http://www.websitebakers.de/sm2/pages/enterprise.php

I think I understand what you are looking for and I am working on adding this to a website as well. I am finalizing the website this week with a few tweeks (dang twitter feed) and adding a few blocks so I do not have to have a separate template for a main page vs everything else.


You will need 2 menu's to get this up and running.
1) Top main menu.--This will be a horizontal menu with our without drowdowns.  (Not sure what you want).
Standard dropdown, but I like to add the SM2_CURRTREE since I am working with a public and members section.  This would be useful if you pages set up for different languages as well.
    - show_menu2(0, SM2_ROOT,SM2_ALL , SM2_ALL|SM2_CURRTREE)        (this  example has dropdown)

Your example:  HOME, ABOUT, and CONTACT would be the main menu with THE COMPANY and THE OWNER  as dropdown from ABOUT.

2) Side menu - This will be a vertical menu appear on the page.
SM2_CURRTREE is how you can show just the sub menus from that page.
If your other pages had sub menus without the SM2_CURRTREE they would also appear in the list.

show_menu2(0, SM2_CURR+1, SM2_CURR+1,SM2_ALL|SM2_CURRTREE

Your example.
A vertical menu would appear on the ABOUT page listing
--- THE COMPANY
--- THE OWNER



Issues / items to think about. 

1)  Because this is a template to all of your pages.  This will appear on your main welcome page.  Do you really want this on all of your pages?  If the answer is no, may just be easier to hard code these link into a block and add add to one page.  Issue there is that if you add or remove pages, you will have to update these links as well.

2)  If there is no sub-menu, what happens as a default?  In my testing it depends on your css behind the scene and how you incorporate it.  Does the block disappear and everything shift left, or does the with this is that on your main welcome screen it will also have this vertical menu.

I initially threw the menu in a block, but when I didn't have a block on the page, the menu did not show up.
After taking it out of the block it appeared on every page, but currently looking on an if then statement that would now show this vertical menu on the welcome page.

Try the code and if it doesn't work send me a pm and I'll see what I can do to help.
If anything I can send you a link to my page after I have completed the website and you can review to see if this is what you are looking for.

sky writer

I would like to implement this functionality on a site.  Did you ever find a solution?

KP

I learn something new about show_menu2 everyday, but I still have questions :)

Is it possible to take a menu with a sub navigation drop-down like:

- HOME
- ABOUT
--- THE COMPANY
--- THE OWNER
- CONTACT

... and display the drop-down items (THE COMPANY, THE OWNER) as links in the content area of the CMS? So you can still click on "ABOUT" but have a mini menu within the page text area that links to the two sub pages? I know you can manually link them with text-links, but it would be nice to be able to set it up so it automatically updates as pages change under a top-level menu item.

Thanks in advance for any insight.
kevin