WebsiteBaker Support (2.8.x) > Templates, Menus & Design

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

(1/2) > >>

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

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

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 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:
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.

Navigation

[0] Message Index

[#] Next page

Go to full version