Author Topic: show_menu2: valid XHTML and CSS selectable menus  (Read 198920 times)

Offline bupaje

  • Posts: 592
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #300 on: July 23, 2009, 05:18:56 PM »
I have a minor css issue and wonder if someone sees something obvious. This menu looks good in FireFox and IE7 but in IE8, unless I use compatibility mode, the menu li renders odd - double bullets or the link is below and right of the li. I'm not sure if this is IE8's problem or the structure I have here.

Here's a page that uses this and following is the code

http://stormvisions.com/pages/library.php

Code: [Select]
$options = array('flags' => SM2_TRIM, 'notrim' => 1);

show_menu2(
        $aMenu          = 0,
        $aStart         = SM2_CURR+1,
        $aMaxLevel      = SM2_ALL,
        $aFlags         = SM2_ALLINFO|SM2_PRETTY,
        $aItemOpen      = '<li class="[class] button[page_id]"><a href="[url]" target="[target]" [if(level==0){class="topitem"}][if(level==1){class="subitem[page_id]"}]>[menu_title]',
        $aItemClose     = '</li>',
        $aMenuOpen      = '</a></li><ul>',
        $aMenuClose     = '</a></ul>',
        $aTopItemOpen   = false,
        $aTopMenuOpen   = false,
        $options
        );




brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #301 on: July 24, 2009, 02:13:23 AM »
I can see a few issues.

Your open menu and close menu tags are strange. Put the closing </a> in the item open. Get rid of the </li> from menu close. i.e. menu open = '<ul>' and menuclose is </ul>. Item open is <li> ..., Item close is </li>.

The $options array should replace the $aOptions (was called aFlags) parameter if you are wanting to use it. i.e.
$options = array('flags' =>SM2_ALLINFO|SM2_PRETTY|SM2_TRIM, 'notrim' => 1);
... $aOptions = $options, ....

Try that.
B

Offline bupaje

  • Posts: 592
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #302 on: July 24, 2009, 03:16:01 AM »
Thanks brofield. That's what I needed.

pixotec

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #303 on: July 28, 2009, 10:02:43 PM »
I have defined multiple menues.
menu[3] is the "TopMenu" in two languages.
So I created
EN_TopMenu (Menu Link page) (level 0 in menu[3])
- Contact (level 1 in menu[3])
DE_TopMenu (Menu Link page) (level 0 in menu[3])
- Kontakt (level 1 in menu[3])

This menu is not in the path of the current page (let's say the homepage).
(So any use of SM2_CURR does not work).

I want to show only the TopMenu in the current language (EN -> Contact), so I tried:

Code: [Select]
<?php show_menu2(3SM2_ROOT+1SM2_STARTSM2_ALL, &#39;[li][a][menu_title]</a>[/li]&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, false, false); ?>
But I get both language links: Contact and Kontakt.

How to get only the TopMenu of the current language?

brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #304 on: July 29, 2009, 03:02:18 AM »
You can't. Use a single menu tree with hidden branches for your special menus. Then you will be on the path and it will work.

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #305 on: August 07, 2009, 06:15:21 PM »
@Brofield.

Some Users have had some troubles due to the fact that with the latest version of SM2 the "Hidden Pages" are visible in the menu if active.

User "DarkViper" opened this german discussion to provide a workaround.
https://forum.WebsiteBaker.org/index.php/topic,14772.msg93640.html#msg93640
Most of us are interrested in a inclusion of this workaround to the next SM2 Version.
It was good if this could happen soon, so the Dev Team would integrate those changed version into the WB CMS 2.8 Package.

"DarkViper" has two approaches to handle this.

One needs the $aOptions Parameter "SM2_HIDEPAGES" to work
/show_menu2/include.php
Code: [Select]
044  define('SM2_CURRTREE',  0x0400); // bit 10
045  // Begin MOD by ISTeam, Werner von der Decken, 08.2009
046  define('SM2_HIDEPAGES',    0x0800); // bit 11 (reactivate old behavior and dosn't show hidden pages)

047  // END MOD ---

048  define('_SM2_GROUP_1',  0x000F); // exactly one flag from group 1 is required

.
.
.
574  // mark our current page as being on the current path

575     if ($page['page_id'] == $CURR_PAGE_ID) {

576       $page['sm2_is_curr'] = true;

577       $page['sm2_on_curr_path'] = true;

578  // Begin MOD by ISTeam, Werner von der Decken, 08.2009
579       if (($flags & SM2_HIDEPAGES) == 0){

580          unset($page['sm2_hide']); // don't hide the current page
581      }

582  // END MOD ---
583    }


And the second one needs the $aOptions Parameter "SM2_SHOWHIDDEN"

Code: [Select]
define('SM2_SHOWHIDDEN', 0x0800); // bit 11 (set to show hidden pages)
…     …      
    $page['sm2_is_curr'] = true;
    $page['sm2_on_curr_path'] = true;
    if (($flags & SM2_SHOWHIDDEN) != 0){
        unset($page['sm2_hide']); // don't hide the current page
    }


Please would you consider to include one of this solutions?
Also a small comment by "$aOptions" Parameters here where good afterwards:
http://code.jellycan.com/files/show_menu2-README.txt

I hope you have the time to do this right now (or soon).

Please let us know.

Kind Regards,
Stefek
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #306 on: August 10, 2009, 01:31:50 AM »
Hi Stefek,

I have just been sitting on this waiting for someone to come up with a consensus on what they want done.

The original change was based on this person's report:
https://forum.WebsiteBaker.org/index.php/topic,2584.msg82237.html#msg82237

I asked for people's opinion a few times, but didn't get a satisfactory answer as to why it should be one way or another.
https://forum.WebsiteBaker.org/index.php/topic,2584.msg87606.html#msg87606
https://forum.WebsiteBaker.org/index.php/topic,14117.msg89044.html#msg89044

However, on reading that German thread it seems that the following is true:
* hidden pages should always be hidden and not appear in the menu tree
* if "hidden pages" are desired to be shown in the menu tree then they should be private pages

If that is the case, than rather than adding a new option, the current change should be backed out.

Does that seem reasonable?

B

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #307 on: August 10, 2009, 02:51:45 AM »
Hello Brofield.

Yes, it sounds reasonable. It makes the code faster, I guess.

I don't really get, what user "vanbemmel" meant and what he was trying to achieve.
This subject is pretty confusing.

What I can see, this user had have more then one menus (different SM2 calls in the template).
One for the parents, and one for the childs.
Let's assume, the parents has been horizontally arranged, the childs verically.
Then, let's assume, one of the parents is "hidden" and you have access to this parent only through the content (a link in the content area linking to that hidden page).
This hidden page has childs and he wants to show them in the vertically arranged menu.
If this is true, I don't get why he didn't get there.
I have a lot of templates arranged like this with hidden pages and it always worked with the "old" show_menu2.

So I understand that a lot of people are confused about this issue.

Regards,
Stefek
« Last Edit: August 10, 2009, 02:53:56 AM by Stefek »
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Offline ruebenwurzel

  • Betatester
  • **
  • Posts: 8413
  • Gender: Male
  • Keep on Rockin
    • Familie Gallas Online
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #308 on: August 10, 2009, 07:01:53 AM »
@brofield

Quote
If that is the case, than rather than adding a new option, the current change should be backed out.

1.) I vote for the handling of hidden pages like in show_menu 4.7
2.) Can you release a Version 4.9 wich works like 4.7 and wich can be added to WB 2.8. But it would be nice to have this tonight, cause we cannot wait longer with relasing the WB 2.8 final.

Thanks
Matthias

brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #309 on: August 10, 2009, 08:47:32 AM »
4.9 release with default behaviour of 4.7 and using SM2_SHOWHIDDEN to override to get 4.8 behaviour.
http://code.jellycan.com/show_menu2/

It would be nice if you would request changes and releases with more notice in future.

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #310 on: October 14, 2009, 10:58:35 PM »
Hello,

Just testet version 4.9 but nothing different to 4.8

The Hidden Pages are still visible in the menu as soon as they're aktiv.


 :|

Kind Regards,
Stefek
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

doc

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #311 on: October 15, 2009, 07:59:14 AM »
Hi,

Brofield has suspended his support for show_menu2, so maybe the version on his website is not the latest one available. Think WB core team has taken over maintaining for show_menu2 now.

Doc

WebBird

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #312 on: October 15, 2009, 10:34:57 AM »
Maybe it would be good to close this thread and open a new one for SM2 support.

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #313 on: October 15, 2009, 10:48:18 AM »
Hello,
version 4.9 is enclosed in WB 2.8 Final.

But I also used the one from his page - nothing different.

However - I know Brofield made a fantastic Job with this Function. It is so much better that the simple show_menu.
But the latest Change doesn't work properly.

I just used the 'hack' provided by user DarkViper and it works for me.

But there is still a need to implement this behavior into the official SM2 Snippet.

Regards,
Stefek
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

WebBird

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #314 on: October 15, 2009, 11:18:38 AM »
Open a bug report.  :wink:

Edit: Here's the thread where brofield hands over show_menu2

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

Offline Craxx

  • Posts: 266
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #315 on: May 03, 2010, 03:53:08 PM »
Please could somebody help:

The template Multiflex-1 makes this error in cgi_error.log :
show_menu2 error: no flags from group 1 supplied! Exactly one flag is required!

best regards
Craxx;)
Craxx;)

aldus

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #316 on: May 03, 2010, 05:05:04 PM »
This means that one of the following predefined constans are missing at the 4. argument/param
__before__! SM2_PRETTY ...
SM2_ALL
SM2_TRIM
SM2_CRUMB
SM2_SIBLING

So e.g.
Code: [Select]
<?php
show_menu2
(0SM_ROOTSMROOT+1SM2_ALL SM2_PRETTY, ....

will do the trick ...

Kind regards
Aldus

Offline mjm4842

  • Posts: 198
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #317 on: September 15, 2010, 06:22:43 AM »
Hi there,

I am using show_menu2 version "4.9 corrected" on WebsiteBaker 2.8.1 in order to prevent hidden menu items from appearing when you are actually on the hidden page. This works great!

The prolem is that child pages which are set to visible of of a page which is set to hidden don't appear in the menu. Allow me to illustrate with an example for those of you who are more visual:

MY HIDDEN SITE (set to hidden)
+-- HOME (set to visible)
+-- ABOUT (set to visible)
+-- CONTACT (set to visible)
YOUR HIDDEN SITE (set to hidden)
+-- HOME (set to visible)
+-- ABOUT (set to visible)
+-- CONTACT (set to visible)

In the above example, MY HIDDEN SITE and YOUR HIDDEN SITE are hidden as per their setting. However, when I access these two pages, HOME, ABOUT and CONTACT are remain hidden, even through they are set to be visible.

What I want is to have these three HOME, ABOUT and CONTACT pages become visible when I am on the hidden MY HIDDEN SITE and YOUR HIDDEN SITE pages.

If you think you can be of help, it would be most appreciated.

With best regards,

Michael
« Last Edit: September 15, 2010, 06:25:28 AM by mjm4842 »
Frustrated? Spending too much time developing when all you really want is a working website? Contact me directly if I can be of services to you.
___________________ ________


www.tngconsulting.c a

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4463
  • Gender: Male
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #318 on: December 21, 2010, 01:43:07 PM »
In Add-ons Modules Code snippets you can download show_menu2 Version 4.9.3

Dietmar
Note: Once the code has been generated, it is easy to debug. It's not a bug, it's a feature!

Offline mjm4842

  • Posts: 198
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #319 on: December 29, 2010, 04:19:20 PM »
Just in case you are are looking for it, Luisehahne's latest version 4.9.5 of Show Menu2 can be found at:

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

From what I can tell, here is a list of the changes:

New $aOptions

SM2_XHTML_STRICT: From all links, created by [a] or [ac], the 'target' - attribute will be removed to preserve the XHTML-Compatibility.

SM2_NO_TITLE: Supress the value of the 'title'-attributes on links which are created by [a] or [ac] formatted links.

New Format Strings

[menu_icon_0]: URL poining to an image for display normal - status
[menu_icon_1]: URL poining to an image for display active/hover - status
[page_icon]: URL poining to an image relating to the current page

New Conditional Formatting Operand

target: Test against the target attribute (on left) or a string containing a possible target (on right)

I could not find a list of changes so if you notice any other changes, please share with the rest of us.

Michael
Frustrated? Spending too much time developing when all you really want is a working website? Contact me directly if I can be of services to you.
___________________ ________


www.tngconsulting.c a

 

postern-length