WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: lorem_ipsum on September 03, 2010, 11:17:42 AM

Title: show_menu2 (hidden page)
Post by: lorem_ipsum on September 03, 2010, 11:17:42 AM
Hi,

i meet a problem with show_menu2 and my hidden pages.

Actualy i use show_menu2 like this :

Code: [Select]
<?php
show_menu2(1, 2, SM2_ALL, SM2_ALL|SM2_PRETTY, &#39;[li][at][menu_title]</a>&#39;, &#39;</li>&#39;, &#39;[ul]&#39;, &#39;</ul>&#39;, true, false);
?>

The problems, all my hidden pages, are displayed when i'm on it.
I think i make a bad use of show_menu2, but after lot of hours work i think i can't see it -.-


If anyone have an idea... it's with pleasure that i listen him.

Thx
Title: Re: show_menu2 (hidden page)
Post by: Argos on September 03, 2010, 05:57:23 PM
The problems, all my hidden pages, are displayed when i'm on it.

If I understand you well, a hidden page is shown when you are at that page? That would be right, because hidden means "hidden from the menu", and not "hidden from the site".
Title: Re: show_menu2 (hidden page)
Post by: lorem_ipsum on September 03, 2010, 08:27:38 PM
Quote
hidden page is shown in the menu when you are at that page?

Sorry for my english ;)

Actualy my page is hidden in the menu (page legals conditions...), it's what i want, but when i go on the page, show_menu2 show the page in the menu when i'm on it.

Exemple : home | first item | second item and my link in footer for legals conditions.
I click in legals conditions,  and my menu looks like Home | first item | second item | Legals conditions

I think i use a bad paramter in show_menu2 or idk...
Title: Re: show_menu2 (hidden page)
Post by: instantflorian on September 03, 2010, 09:48:23 PM
see
https://forum.WebsiteBaker.org/index.php/topic,14117.msg89132.html#msg89132 (https://forum.WebsiteBaker.org/index.php/topic,14117.msg89132.html#msg89132)
Title: Re: show_menu2 (hidden page)
Post by: mjm4842 on September 04, 2010, 01:27:27 AM
The version of show_menu2 included with Website Baker 2.8.1 actually includes version 4.8 instead of 4.9. The more recent 4.9 version was included in WebsiteBaker 2.8.0.

See the following post for additional information:

https://forum.WebsiteBaker.org/index.php/topic , 18937.msg126629.htm l # msg126629 (https://forum.WebsiteBaker.org/index.php/topic , 18937.msg126629.html # msg126629)

You can get the most recent version from:

http://www.websitebakers.com/pages/admin/core-replacements/show_menu2.php

Unfortunately the info.php file actually reflects the 4.9 version number, even though the rest of the files are actually code from v4.8, so you will have to use replace the existing files in the modules/show_menu2 folder with the new versions that you downloaded from the above link.

With best regards,

Michael
Title: Re: show_menu2 (hidden page)
Post by: lorem_ipsum on September 10, 2010, 05:25:05 PM
Thx for the help,

I've tested with the new files... but i've always the same problem...

I've solve my problem at 50% with another menu structure... but the problem is always here.

When i open my page same like "legal conditions" the "[menu_title]" appeare in submenu now.

i'lll continu to search a solution...
Title: Re: show_menu2 (hidden page)
Post by: mjm4842 on September 10, 2010, 08:40:45 PM
It might help if you can provide a link where we can see the problem as well as a cut and paste of your show_menu2 command with all the parameters.

Michael
Title: Re: show_menu2 (hidden page)
Post by: snark on September 20, 2010, 08:04:24 AM
Maybe both options can be added to THE showmenucode

That would mean you would have an extra option to choose from

 - always hidden ( the old hidden option )
 - hidden until active ( THE new option )
Title: Re: show_menu2 (hidden page)
Post by: mjm4842 on September 21, 2010, 04:37:32 AM
Thanks for the suggestion snoork. That feature actually already exists but to get it, you have to install the latest version of show_menu2 which, for some unknown reason, was in WB 2.8 but didn't make it into 2.8.1.

The problem is, I don't want the hidden menu to show up, only it's siblings which are not set to hidden.

I appreciate you trying to help out.

Michael
Title: Re: show_menu2 (hidden page)
Post by: DarkViper on September 21, 2010, 10:19:59 AM
sometimes it's better to read the manual first...  :wink:

SM2_SHOWHIDDEN  Hidden pages are usually hidden all of the time, including
                when they are active (i.e. current page or a parent page).
                Use private pages for time when you want pages to be
                hidden except when active. However for compatibility with
                release 4.8, supply this flag to enable hidden pages to
                become visible when they are active.

Title: Re: show_menu2 (hidden page)
Post by: mjm4842 on September 21, 2010, 06:11:59 PM
Thanks for taking the time to contribute to this discussion DarkViper.

I am actually already taking advantage of this option. The problem is, it doesn't just hide the menu options that are hidden, it hides all of their children as well, even if these are set to Public visibility. For example:

Main Menu Item 1 (set to public)
Main Menu Item 2 (set to public)
  Menu Item 2.1 (set to hidden)
     Menu Item 2.1.1 (set to public)
     Menu Item 2.1.2 (set to public)
     Menu Item 2.1.3 (set to public)
Main Menu Item 3 (set to public)

I don't want menu item 2.1 to be visible in the main menu. However if a link takes you to that page, I want the user to see menu 2.1.1, 2.1.2 and 2.1.3 but I still don't want menu item 2.1 to be visible.

In a practical application, Menu Item 2.1 could be a course and Menu Item 2.1.1 would be modules in the course. When someone gets access to the course, they should be able to see the modules in it.

The reason I don't want hidden menu items to show up when accessing the pages is because this is not necessarily appropriate for other parts of the website.

If you have any other suggestion, it would be much appreciated.

With warmest regards,

Michael
Title: Re: show_menu2 (hidden page)
Post by: Argos on September 21, 2010, 06:26:21 PM
Hm... it seems a bit odd to me that you want (certain) visitors to see child pages without a parent. It may feel for them like the information has no hierarchical context. Why not put a little info on the parent page, and a droplet showing links to all child pages? That would make sense. Your idea doesn't make sense to me, and that's probably why it's so hard to create in WB, if possible at all.

I'm not trying to get into a debate, by the way, it's just my thoughts when I tried to envision your idea...
Title: Re: show_menu2 (hidden page)
Post by: mjm4842 on September 22, 2010, 05:16:51 PM
Hi Argos,

Thank you for taking the time and putting in the effort into trying to envision scenarios where this could be applicable. I realize you are not trying to start a debate butrather simply trying to understand where I am coming from. The intent expressed in an email can sometimes be misinterpreted and I want you to know that really appreciate your attempt at keeping this conversation moving in a positive direction.

What I am trying to accomplish is to make certain branches of my website accessible only through direct link access. The following is hopefully a less abstract example of a possible site structure:

Home (public)
Booklets (public access)
-- HTML (hidden)
  -- Chapter 1 (public)
  -- Chapter 2 (public)
  -- Chapter 3 (public)
-- JAVSCRIPT (hidden)
  -- Chapter 1 (public)
  -- Chapter 2 (public)
  -- Chapter 3 (public)
About (public)
-- Privacy Policy (public)
-- Important Notices (public )
Hidden Pages (hidden)
   -- Terms and Conditions  (hidden- used by Bakery)
   -- Other misc. hidden pages.
Contact Us (public)

HTML and JAVSCRIPT would be titles of on-line booklets that I want to give away in exchange for a person's name and email address. As such, the booklets should not appear in any menu which is why these pages are set to hidden.

To make this work, I use MPForm to create those Free Stuff type forms on my site. I also enable MPForm to automatically send a confirmation email back to the user. That email has been customized to contains a direct link to the on-line book. MPForm is also set to automatically send me a confirmation email me containing their contact information and as well as the title of the booklet that they were interested in so that I can personally follow up with each visitor who took advantage of my free offer. A perfectly automated system which required little more than initial setup on my part.

The way show_menu2 works right now, all they will see on that page is the booklet's home page, which contains a thank you/welcome type message. Even though the Chapter pages are set to be public, the Chapters will not appear in the menu. It is important that the chapters appear in the menu so that users can easily navigate from one chapter to the other.

I would rather not get into creating and managing thousands of WB user accounts for free giveaways and I don't want to enable visibility of hidden pages in the menu because then other hidden pages on my site, such as the Terms and Conditionspage for Bakery (and others), that would end up also appearing in the menu when they really should not.

Don't get me wrong. I can certainly see your point in making the page visible in the menu when you are on the page itself. Unfortunately there are also many situations where this is not desireable. For example, If someone was accessing the "Terms and Conditions" page, I would not want "Hidden Pages" to appear in the menu.

Hopelly this clarifies things for you. Let me know if you need another example using something other than booklets.

With warmest regards,

Michael
Title: Re: show_menu2 (hidden page)
Post by: Argos on September 22, 2010, 09:04:13 PM
Hi Michael,

thanks for your efforts to make it more clear. It's a lot of work to create such a structure with the forum software  :-D

What you may give a try is using the SiteMapChild droplet: http://www.websitebakers.com/pages/droplets/official-library/navigation/sitemapchild.php.

I tested it, and it works just like you want, I think. I created a hidden parent and three visible child pages. I added droplet to both parent and childpages. Since the parent has ID 13 in my testsite, the droplet is [[SiteMapChild?start=13]]

If you put the droplet in a DIV, you can style it with CSS to look like a sub menu.
Title: Re: show_menu2 (hidden page)
Post by: mjm4842 on September 23, 2010, 08:37:32 AM
Thank you for your research and your patience Jurgen. There are so many modules, snippets and droplets that I have not managed to make my way through all of them yet.

Ideally it would be nice to be able to fix show_menu2 however I will definitely give the droplet a try and see how it goes.

Thanks again.

With best regards,

Michael
Title: Re: show_menu2 (hidden page)
Post by: Argos on September 23, 2010, 10:08:51 AM
It would really surprise me if showmenu could be customized to show children of an always hidden parent, because the children would be "dangling in mid air" so to speak :-D

But maybe some showmenu guru will come up with a solution... In the mean time the droplet path may be good enough. You can also use 2 different menus I guess (1 regular, and 1 with a similar output as the droplet), but I didn't try that.

Good luck!
Title: Re: show_menu2 (hidden page)
Post by: mjm4842 on September 23, 2010, 04:01:34 PM
Thanks for the suggestion Jurgen.

I don't mind doing a little coding when it's for my own site however the droplet idea is already a bit of a stretch for my clients who use WebsiteBaker because of it's simplicity. I'm afraid that anything involving code would send them running. I usually try to fix the problems rather than create work-around them because innevitably the workaround just complicates things.

Thanks again!

Best regards,

Michael