Hello World + ShowMenu2 modules marriage

maxpower

Sheesh.  These were obvious solutions that I should have thought of.   :roll:  Thank you both BerndJM and Matthias for your help.  I guess it was one of those situations where one "can't see the forest for the trees."  I was so wrapped up in getting a sibling menu on a page that I didn't see that fact I could already do this with the built in functions of SM2. 

I first followed Matthias suggestion and made two identical templates with the 2nd template having the menu call to the sub links.  That worked, but I found that if I wanted to tweak and change whatever's hardcoded into the 1st template, I'd have to make those changes into the 2nd template as well. 

I ultimately followed BerndJM's suggestion as that did exactly what I wanted.

I'm hoping to go live with this website soon and I'll make a post in the showcase section when I do.

BerndJM

Hi,
if I understand you right, you have the following page structure:


Team A
   Week 1
   Week 2
   Week 3
   ...
Team B
   Week 1
   Week 2
   Week 3
    ...
Team C
    ...


So it shouldn't be too difficult to do it with one template, just use this show_menu2 calls:

For the "Teams-Menu":
show_menu2(0, SM2_ROOT, SM2_START);
so it shows: Team A - Team B - Team C - ...

and for the "Weeks-Menu":
show_menu2(0, SM2_ROOT+1, SM2_START);
so it shows: Week1 - Week2 - Week3 - ... (depending on the choosen Team)

How to display horizontal/vertical is then only CSS stuff.

Regards Bernd
In theory, there is no difference between theory and practice. But, in practice, there is.

ruebenwurzel

Hello,

Quotebut now I'm noticing that when I want to make a change to my website that I'm having to do it twice.
???????

Don't understand, can you explain what you mean?

Matthias

maxpower

Thanks, I followed your advice, but now I'm noticing that when I want to make a change to my website that I'm having to do it twice.  Just wondering whether there's another option to accomplish the same goal using one template?

ruebenwurzel

Hello,

you can use in WB different Templates. So from your descriptions the easiest way seems the following:

1.) Make a copy of your template, add the horizontal menu, give the template another name and install it.
2.) Give all pages wich should have the horizontal menu this template.

Thats the basically all, but to get it working as you wanna have, you must have a well structured and caonfigured page.

1.) You need to have "multiple Menus" activated
2.) both menus must be added to both templates
3.) All menu points must be added to the menu where they should appaer
4.) the menu calls should be adapted from wich point they should start

For all this read the docu on our help page, both multiple menus anbd also the menucall paramaters are explained there.

Last but not least all what you want can be reached with builtin technics, there is no need for writing an special modul for this :wink:

Matthias

maxpower

I was thinking this:  put the showmenu2 code of hidden links into a hello world module, and then installing that module with the particular showmenu2 code on any page I want. 

The hello world module seemed so much simpler without the documentation somehow.  Now, it comes bundled with so many files that it makes working with it a daunting task (for a noob like me anyways).   Also, the showmenu2 has built into it the conditional settings that "if 'this page, then this link'" but I'm not at that stage of fully understanding either of these modules yet. 

This seemed liked a viable alternative to me.  Yet, even after reading the documentation of both modules leaves me with questions.  Thus, I come to you - the wonderful WebsiteBaker community - for a little assistance.   

I'm sure there's other ways of accomplishing the same task that hasn't occurred to me yet.  I'm open to suggestions.


here's a brief description of what I am trying to do.  I have vertical links of football teams.  When clicking on a particular team, a page would appear with horizontal links showing that teams schedule for weeks 1-16. 

i.e.
Dallas Cowboys would be a vertical link, and when clicked, it would display 16 individual horizontal links .  It's those 16 horizontal individual links that would be hidden and that menu's code taken to be put into the hello world module.

Yikes!  It sounded simple to me when I thought of the idea and now that I try to explain what I mean, it seems complicated.  I can try to explain what I mean if this isn't clear enough.

Thanks for the support and bye for now   :lol: