show_menu2: valid XHTML and CSS selectable menus

brofield

New version released now. show_menu2 v4.7 adds new functionality. See the readme.en.txt or readme.de.txt files. Note the Extended Options that are now possible. This is the only difference from 4.6 - there is no reason for 99.9% of people to upgrade. See the topic https://forum.websitebaker.org/index.php/topic,11150.html for details of how the new option may be used.

Download from http://code.jellycan.com/show_menu2/

Regards,
Brodie

brofield

rrjbeans:
you are using the page name as a class. A class cannot have periods in it. Ergo, what happens next is anyone's guess.

fsuk:
if it is supposed to. i.e. the person is logged in and has been given access to that page.

fsuk

You say deviant like its a bad thing...

rrjbeans

Hello,

I installed wb 2.7 and used css to style drop down menus using show_menu2. Position is set to "absolute" for the submenus so they can popout correctly.

Having one or more period characters in the menu title, and it appears that wb ignores such positioning specified. Remove the periods in the menu title and it returns to normal.

SHOW_MENU2 SETTINGS IN TEMPLATE...
<td id="nav"><?php show_menu2(
        
$aMenu          0,
        
$aStart         SM2_ROOT,
        
$aMaxLevel      SM2_ALL,
        
$aFlags         SM2_ALL,
        
$aItemOpen      '<li class="[menu_title] [class] lev[level]">[a][menu_title]</a>',
        
$aItemClose     '</li>',
        
$aMenuOpen      '[ul]',
        
$aMenuClose     '</ul>',
        
$aTopItemOpen   false,
        
$aTopMenuOpen   false
        
); ?>
</td>


STYLES.CSS
#nav li {
   display: inline;
        position: relative;
}


#nav ul li.lev0 {
        padding-left: 10px;
        padding-right: 10px;
}

#nav li.menu-current {
   background-color: #C0C0C0;
}

#nav li:hover {
        background-color: #C0C0C0;
}

#nav a {
   color: black;
        text-decoration: none;
}

.1 {
   vertical-align: middle;
}

#nav ul li {
   position: relative;
}

#nav ul ul {
   display: none;
        position: absolute;
}

#nav ul ul ul {
   display: none;
        position: absolute;
        left: 100%;
        top: 0;
        width: 100%;
}

#nav ul ul,
#nav ul li:hover ul ul,
#nav ul ul li:hover ul ul
{display: none;}

#nav ul li:hover ul,
#nav ul ul li:hover ul,
#nav ul ul ul li:hover ul
{display: block;}

#nav ul li:hover ul {
   display: block;
        font-size: small;
        /*border: 1px solid black;*/
        background-color: #C0C0C0;
        width: 90px;
        filter: Alpha(Opacity=70, FinishOpacity=75, Style=1, StartX=1, StartY=1, FinishX=20, FinishY=20);
        opacity: 0.7;
        moz-opacity: 0.7;
}

#nav ul ul li:hover ul {
   display: block;
        position: absolute;
        /*left: 600px;
        top: 0;*/
        /*left: 195%;*/
        /*margin-top: -30px;
        margin-right: -100px;*/
        font-size: small;
        /*border: 1px solid black;*/
        background-color: #C0C0C0;
        width: 90px;
        filter: Alpha(Opacity=90, FinishOpacity=95, Style=1, StartX=1, StartY=1, FinishX=20, FinishY=20);
        opacity: 0.9;
        moz-opacity: 0.9;
}

#nav ul li.About:hover ul {
   left: 0px;
        margin-top: 28px;

}


#nav ul li.Studio:hover ul {
   left: 0px;
        margin-top: 28px;

}

#nav ul ul li.Classes:hover ul {
   left: 90px;
        margin-top: 0px;
}

#nav ul ul li.Calendar:hover ul {
   left: 90px;
        margin-top: 0px;
}


#nav ul ul li {
        list-style: none;
        background-image: none;
}

#nav ul ul li:hover {
   background-color: #FFFFFF;
}

#nav ul ul li a {
   border-top: 1px solid #C0C0C0;
        border-bottom: 1px solid #C0C0C0;
        text-indent: -40px;
        text-align: left;
        list-style: none;
        background-image: none;
        display: block;
}

#nav ul ul li a:hover {
   background-color: #FFFFFF;
        border-top: 1px solid #990000;
        border-bottom: 1px solid #990000;
        margin-left: -40px;
        text-indent: 0px;
        display: block;     
        filter: Alpha(Opacity=120, FinishOpacity=125, Style=1, StartX=1, StartY=1, FinishX=20, FinishY=20);
        opacity: 1.2;
        moz-opacity: 1.2;}

#nav ul li.menu-expand {
   background-image: url(http://fladance.org/beta/media/down-arrow-sm.png);
        background-repeat: no-repeat;
        background-position: right;
}

#nav ul ul li.menu-expand {
   background-image: url(http://fladance.org/beta/media/right-arrow.gif);
        background-repeat: no-repeat;
        background-position: right;
}


MENU STRUCTURE:

Home
About
- History
- Staff
- Board
Studio
- Classes
-- one
-- two
-- three
- Calendar
-- Schedule
-- News
- Summer
Gallery
Contact Us

MENU STRUCTURE THAT MESSES MENU POSTIONING UP:

Home
About
- History
- Staff
- Board
Studio
- Classes...
-- one
-- two
-- three
- Calendar...
-- Schedule
-- News
- Summer
Gallery
Contact Us


brofield

re: tag cloud
Tag clouds take into account everything in the menu tree, not just the current page. I think this is best left to a specific addin module.

bupaje

@brofield - a quick idea to consider ....

I note that using show_menu2 sitemap example, and removing everything except [keywords] it is possible to create a 'fake' tag cloud of sorts. I wondered if it might be possible to add a 'tag cloud' format to your show_menu2, with some  css options to vary text size color.


BerndJM

@brofield:
QuoteThe lack of classes on the ul tag is normal. It has always been this.
Funny, I never noticed this before ... :roll:

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

BerndJM

Hi,

to use teh [description] tag you have to set the SM2_ALLINFO flag:

show_menu2(0, SM2_CURR+1, SM2_ALL, SM2_ALL|SM2_CURRTREE|SM2_ALLINFO);

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

bupaje

Hi. Can someone help me with a question? I've tried this but not doing it right as when I change I get errors in the log or no data.

This page ...

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

This code works ...



echo'<h3>Categories</h3>';
echo'<div style="border-width:0px;">';
show_menu2(0, SM2_CURR+1, SM2_ALL, SM2_ALL|SM2_CURRTREE);
echo'</div>';


I just want to add the description tag...


[DESCRIPTION]


can anyone show me the answer?

Thanks very much.

Burt

brofield

@bernd
Apologies my friend. Thanks for the German translation. The lack of classes on the ul tag is normal. It has always been this. The list of classes used for the list open is set by the function startList(). The only classes that will ever be used are "menu-top" and if numbered menus are enabled, "menu-N". The list of classes for the items are far more numerous. The documentation doesn't mention this.

Cheers,
Brodie

avde

Quote from: brofield on June 13, 2008, 12:23:29 PM
Manually install it.

take a copy of the existing modules/show_menu2 directory
delete all of the files
unzip the show_menu2.zip file
copy all of the files into the modules/show_menu2 directory

B

Thanks mate! It worked, after manually upolading the new files I only had to reload add-ons with the Admin-Tool and now it shows 4.6 under module info and the menu is shown on the search page! Thanks a lot for the kind support!

BerndJM

Hi Brofield,

sure the the SM2 call :
show_menu2(1, SM2_ROOT, SM2_ALL, SM2_TRIM|SM2_PRETTY);
Nothing exotic - did I miss something?

And thanks for the link to the docu - I made the german translation, so I'm quiet sure I read it :lol:

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

brofield

Manually install it.

take a copy of the existing modules/show_menu2 directory
delete all of the files
unzip the show_menu2.zip file
copy all of the files into the modules/show_menu2 directory

B

avde

@brofield:
yeah I know I have the wrong version, but I can't upgrade to 4.6... If I just install show_menu2-4.6.zip it says upgraded sucessefuly but under module info it remains 4.5... If I try to uninstall the show_menu2 module before upgrading I get "cannot uninstall"...
So what should I do? How can I upgrade the module?

brofield

@BerndJM:
Can't say without seeing the parameters for sm2. I suspect a problem with your call. See the doco.
http://code.jellycan.com/files/show_menu2-README.txt

@avde:
Try the main site. The addons repository should just link there anyhow. The info data is 4.6 so if it doesn't show that then you probably have the wrong version installed.
http://code.jellycan.com/show_menu2/

avde

#228
Quote from: doc on April 22, 2008, 09:11:10 PM
Hello,

just released show_menu2 version 4.60 which includes the page_id = 0 bug fix from Brofield on the addons repository.
If your menu disappears after submitting a search, follow the steps below (requires show_menu2 v4.60 or higher)

Step 1: Add the following input field to the database search settings after
the <form> open tag: WB Backend -> Settings -> Show advanced settings -> Search Settings -> Header
<input type="hidden" name="referrer" value="[REFERRER_ID]" />

Step 2: In the index.php of your template, add the following input field immediately following the search <form> open tag.
<input type="hidden" name="referrer" value="<?php echo defined('REFERRER_ID')?REFERRER_ID:PAGE_ID;?>" />


Brofield thanks for this bugfix.

Regards Christian

I can't get this fix to work... I have upgraded the module to 4.6, but under module info it still says 4.5, and the fix is not working... When I use the search, the menu dissapears... What's up with that? Is the right version of show_menu2 on the server?
I have tryed to uninstall the module first, but I get "Cannot uninstall". What should I do?

BerndJM

Hi Brofield,
just noticed the following:

<ul class="menu-top">
    <li class="menu-sibling menu-first">...</li>
    <li class="menu-expand menu-current menu-last">...
     <ul class="">
        <li class="menu-child menu-first menu-last">...</li>
     </ul>
    </li>
</ul>

The class in the child-menu ul is empty.
Bug or feature?

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

bupaje

I guess I mucked around with it too much. Since the page still worked I don't even know when I broke it.I went back to one of your examples and left it at that. Works fine now. Thanks.

brofield

Read the documentation and check the parameters you are using again. You're not passing the correct flags to the function for the $aFlags parameter.
http://code.jellycan.com/files/show_menu2-README.txt

bupaje

Hi. I get this error in the scripts.log I have error level set to E_Error which I read is for fatal errors but show_menu2 seems to work great as always. I am setting up new pages so some of the subpages have no content yet which I guess is possible.


show_menu2 error: no flags from group 1 supplied! Exactly one flag is required!


I only noticed it because the error file has gotten huge .

Thanks.


doc

#223
Hello,

just released show_menu2 version 4.60 which includes the page_id = 0 bug fix from Brofield on the addons repository.
If your menu disappears after submitting a search, follow the steps below (requires show_menu2 v4.60 or higher)

Step 1: Add the following input field to the database search settings after
the <form> open tag: WB Backend -> Settings -> Show advanced settings -> Search Settings -> Header
<input type="hidden" name="referrer" value="[REFERRER_ID]" />

Step 2: In the index.php of your template, add the following input field immediately following the search <form> open tag.
<input type="hidden" name="referrer" value="<?php echo defined('REFERRER_ID')?REFERRER_ID:PAGE_ID;?>" />


Brofield thanks for this bugfix.

Regards Christian

Boudi

Hello,

Unfortenately Brofield is momentarily very busy and I respect that off course. So in a short term a solution from him would be difficult what is highly understandable.

So If anyone knows a solution for this issue on a short term or has a good working show_menu2 configuration regarding this issue then would you please share it with us. I would be heavenly greatfull since this topic is bugging me for a month now and I'm keep stretching up the deadline of my client  :|

Sincerly,
Knert

...:: Bake the Unbakable ::...

doc

Hello,

well it is not really a bug of the show_menu function, it is more the way how WB handles search pages. The page_id is set to zero if you are using the search, therefore the menu disappears with the WB menu functions (show_menu) and the external menu function show_menu2().

Maybe Brofield find out a solution which works without changing WB core files, maybe we need to adapt WB core files, maybe both.

Regards Christian