Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 05:44:04 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Menu Link - only want it to show submenus  (Read 1932 times)
kriskd

Offline Offline

Posts: 63



« on: September 22, 2007, 04:59:33 PM »

I have a menu link with several sub-menus under it.  When an user clicks on that menu link, I simply want the submenu items to display and not get the "Click HERE to go to the main page" message.

I do this on a different webpage of mine which is just a static webpage with no CMS behind it.  You can see it here:

http://www.sprechereast.com (Click on "Meeting Minutes" to see this effect).  It's accomplished with a little javascript and the display element in my style sheet.

I imagine I probably need to switch to show_menu(2) to accomplish this.  I've looked over the documentation and demos for this at  Jellycan Code and am completely lost.  I'm not a PHP programmer and would need to be "hand held" through this.

This is how I currently call my menu:

Code:
<?php page_menu(01'<li [class]>[a][menu_title][/a]</li>''<ul id="navlist">''</ul>''''  class="current"'); ?>

Can someone help me out?
Logged
Waldschwein
Guest
« Reply #1 on: September 22, 2007, 09:39:56 PM »

Hello!

Have you checked the documentation of menues here?
Only displaying could be realised perhaps better with show_menu2. The code from could probably be:
Current Kids
show_menu2(0, SM2_CURR+1, SM2_CURR+1);

Check out the sites, I think nearly every possibility you could imagine are given. Wink

Regards Michael
Logged
kriskd

Offline Offline

Posts: 63



« Reply #2 on: September 22, 2007, 10:42:50 PM »

show_menu2(0, SM2_CURR+1, SM2_CURR+1);

Thanks!  I'll give that a try when I have a moment.

What about working in my ids/classes as in my current code?  How does that fit in?
Logged
kriskd

Offline Offline

Posts: 63



« Reply #3 on: September 23, 2007, 01:22:47 AM »

I installed version of 2.4.4 of showmenu2 and added <?php show_menu2; ?> to my template, but nothing is being generated.  Am I missing a step?

I verified it's installed in the module portion of the admin panel because it's in the list to be uninstalled and info is available for it.

However, when I FTP to my server, I'm not seeing a folder for it under the rest of my modules.  Should there be something there?
Logged
DjangoScroll

Offline Offline

Posts: 5



« Reply #4 on: September 23, 2007, 02:21:54 AM »

Quote
I installed version of 2.4.4 of showmenu2 and added <?php show_menu2; ?>

<?php show_menu2; ?> or <?php show_menu2(); ?> ??

if <?php show_menu2; ?> don'twork without the ()
« Last Edit: September 23, 2007, 02:34:24 AM by DjangoScroll » Logged
Waldschwein
Guest
« Reply #5 on: September 23, 2007, 06:45:16 AM »

Hello!

1.) Please don't open too many threads to the really same topic. I have merged the topics.

2.) Look here: http://code.jellycan.com/sm2test/ The "default" show_menu2 code is:
show_menu2();
With php tags then:
<?php show_menu2(); ?>
The function describe into the brackets, like:
<?php show_menu2(0, SM2_ROOT, SM2_START); ?>

Regards Michael
Logged
kriskd

Offline Offline

Posts: 63



« Reply #6 on: September 23, 2007, 11:32:25 AM »

Thanks for the replies.  This is making a little more sense now.

Back to my original question.  Is using the menu link which should not have a page associated with it, but rather just make the sub-menus appear under it when clicked still the best way to approach this (see my example link in my original post)?  Obviously I want my structure in the admin panel set up as it should before I tackle the show menu.
« Last Edit: September 23, 2007, 12:10:09 PM by kriskd » Logged
kriskd

Offline Offline

Posts: 63



« Reply #7 on: September 24, 2007, 10:03:29 AM »

I'm hoping someone can comment on this soon as I'm to the point with my website that I'm done with everything else except for that menu.  I'd like to know if I should use a menu link in the admin panel as questioned in my original post and previous post.

Alternatively, I should look through the template repository and see if any of the template do this with menus/submenus.  If anyone can recommend a template where you click on a menu item and it just opens the submenus below, I would appreciate that!
Logged
Waldschwein
Guest
« Reply #8 on: September 24, 2007, 10:12:22 AM »

Hello!

Well, it could be realised (I think you mean showing the children of a page when viewed and the pages in the same level, am I right?). But I would not recommend to do it with javascript (well, I wouldn't recommend using javascript at all except there is no other way).

Why don't you simply search the show_menu2 demo-page? There are many examples, and also the one you think of. 
Children/Siblings
This is often used when splitting menus between the root menu and a side menu showing the children of the current page. This menu will show all of the children of the current top level menu, but will continue to display the siblings of child pages as well when a lower level menu is selected.
show_menu2(0, SM2_ROOT+1, SM2_CURR+1);

I think that's the one you think of.

Regards Michael
Logged
kriskd

Offline Offline

Posts: 63



« Reply #9 on: September 24, 2007, 11:45:31 PM »

I placed the following on my page:

<?php show_menu2(0, SM2_ROOT+1, SM2_CURR+1); ?>

And the menu completely disappears!  Huh  However, <?php show_menu2(); ?> does display the menu, although I'd like to see what some of these other options would display if I can get them to display anything at all!

Besides the menu code, my other challenge was organizing my content and figuring out what made sense for the backend.  I checked out some of the other sites in the showcase to get some ideas on this and the following site basically has the concept I want (or at least can live with since I'm trying to avoid javascript):

http://www.gramatec.de/en/

Similar to this site, I made the 'parent' a menu link which points to the first child when clicked.  The menu expands like I want, however I have some CSS issues I need to work through.

Any thoughts why any of the variations of <?php show_menu2(); ?> won't display anything for me?
« Last Edit: September 25, 2007, 01:24:47 AM by kriskd » Logged
kriskd

Offline Offline

Posts: 63



« Reply #10 on: September 29, 2007, 12:43:52 PM »

After lots of reading and lots of playing around, I finally got what I needed:

Code:
<?php show_menu2(1SM2_ROOTSM2_CURR+1,SM2_TRIM,'[li][ac][menu_title]</a>','</li>'); ?>

Great mod, but quite the learning experience for me!
Logged
babsy

Offline Offline

Posts: 322


« Reply #11 on: December 10, 2007, 08:55:24 AM »

Hi....

i need some help, if possible, i did what you wrote in this threath.. and installed the module (menu2) and used your code in my index.php in my template.... but i still see the text "Go to mainpage......."....?

any idea why?
« Last Edit: December 11, 2007, 09:13:10 AM by babsy » Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!