WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • show_menu2: valid XHTML and CSS selectable menus
  • Print
Pages: 1 ... 6 7 [8] 9 10 ... 13   Go Down

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

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #175 on: March 22, 2007, 06:29:55 PM »
Currently your SM2 should still try to create a list, since you don't pass on special tags for the $aMenuOpen and $aMenuClose

You should open and close a form around it, at the end, an Optionlist is a form element. And don't forget the "select" tag around it as well ... pass it on via the SM2 variables. They are explained in the readme file.


cheers

Klaus
« Last Edit: March 22, 2007, 06:33:32 PM by kweitzel »
Logged

hobo_geek

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #176 on: March 28, 2007, 05:40:14 PM »
Sorry its taken me so long to get back to you been busy with project work so have had little time to work on this.

I forgot to mention that I have other menus that use that need the SM2 to create a list. From what I've read from the documentation would I be correct in saying that I'd need need to define $aTopItemOpen in the include.php?

Sorry I'm new to the show_menu2 module and I get the basics of it but sometimes the documentation I think can be very unclear/confusing for newcomers. 
Logged

brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #177 on: March 29, 2007, 08:30:12 AM »
Why don't you have a look at the HTML that sm2 is generating? If you are still trying to solve the original problem, then follow kweitzel's advice and add entries for $aMenuOpen and $aMenuClose. Read the perhaps-confusing-but-all-you-got documentation for details of what these do. From your sample before you probably just want empty strings for these tags.
Logged

hobo_geek

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #178 on: March 29, 2007, 07:54:02 PM »
Ok I think their might be some confusion here about what I'm attempting to do. So I'll attempt to clear it up.

I want to have two menus in my baker template such as:

1. One menu created by the default   

$aItemOpen     = '
  • [a][menu_title]</a>'
    $aItemClose     = '</li>',

    2. The other which is an option list of all the pages available.

    As you can see I can't change the $aItemOpen and $aItemClose to empty tags as the first menu won't work. I'm sorry if you were offended by my suggestion of the documentation being confusing for me as it took me quite a while to figure out exactly what you meant by the more advanced features. However, thank you to you both for helping me with my ongoing problem :-D
Logged

brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #179 on: March 30, 2007, 06:15:02 AM »
Takes a lot more to offend me than that. Without concrete examples of what is wrong with something and suggestions for how it might be fixed then criticism is usually not constructive.

2 menus = 2 calls to sm2 = 2 sets of parameters.

i.e.
menu 1 = show_menu2( .. normal menu tags .. );
menu 2 = show_menu2( .. empty menu tags .. );

I don't see the problem.
Logged

Danko

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #180 on: April 20, 2007, 08:22:27 PM »
Does this snippet support foreign language?
When I key in Chinese text, it shows code instead.
(btw, Chinese text appears OK in content area)

Thanks for helping.
Logged

Offline ruebenwurzel

  • Betatester
  • **
  • Posts: 8544
  • Gender: Male
  • Keep on Rockin
    • Familie Gallas Online
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #181 on: April 21, 2007, 10:37:05 AM »
Hello,

the show_menu2 function is independend from the language. Pagenames and Menutitles are generated from the core files of WB. If you have issues with this maybe this link is helpfull:

Quote
http://forum.WebsiteBaker.org/index.php/topic,5730.msg37501.html#msg37501

It is a german thread but the attached files should solve all language issues. If you have installed wb 2.6.5 you can download the zip package from this post, unzip and overwrite the files on your hist with the new ones. All pages wich are created after this "upgrade" should look ok.

Matthias
Logged

Danko

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #182 on: April 21, 2007, 01:15:17 PM »
Thanks Matthias.

It WORKS!  :lol:
Logged

nickleermans

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #183 on: April 28, 2007, 02:20:43 PM »
I've tried many combinations of the code but I can't find the right one.

I have the following:

Topic 1
- Sub Topic 1a
- Sub Topic 1b
- Sub sub Topic 1ba
Topic 2
- Sub Topic 2a
- Sub Topic 2b
- Sub sub Topic 2ba
- Sub sub Topic 2bb

What I want is:

When you are in one of Topic 1's Children (Sub Topic 1a, - Sub Topic 1b or Sub sub Topic 1ba) then I want the menu to show all of the children of 1.

When you are in one of Topic 2's Children (Sub Topic 2a, - Sub Topic 2b, Sub sub Topic 2ba or Sub sub Topic 2bb) then I want the menu to show all of the children of 2.

The result has to be that there are 2 menu's: one with all the children (and sub children) of Topic 1 and one with all the Children (and sub children) of Topic 2.

I hope that someone know what I mean and have an answer!  :-D
« Last Edit: April 28, 2007, 02:22:24 PM by nickleermans »
Logged

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #184 on: April 28, 2007, 06:37:24 PM »
Easiest way ... make 2 menu's (look for multiple menu in forum). Use standard menu call in template, just calling the menu numbers.

Harder way ... read the documentation of show menu 2 and make the relevant page_ids the starting point.

cheers

KLaus
Logged

Offline gokcer

  • Posts: 94
This is perfect
« Reply #185 on: June 12, 2007, 12:04:02 PM »
Especially being able to create UDM4 Popup menus... Most of my customers want to see all submenus as rollover/sliding items in the menu bar. Now i can make it :-D.

Very much thanks to you brofield.
Logged

Boboga

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #186 on: August 08, 2007, 09:10:55 AM »
In reply to http://forum.WebsiteBaker.org/index.php/topic,5836.0.html

I'm also running into the same issue, I'm not a star with CSS but I think the problem is that the 'menu-expand menu-parent' doesn't have an "a href" with it so it breaks the CSS..

Anybody any idea for me how to fix this? :)
Logged

brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #187 on: August 15, 2007, 03:02:36 AM »
Version 4.1 now available at http://code.jellycan.com/show_menu2/

    * Support for an else clause in conditional formatting.
    * Tested against latest version of WB (2.6.7)

B
Logged

Offline BerndJM

  • Posts: 1764
  • Gender: Male
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #188 on: August 15, 2007, 01:33:38 PM »
Hi brofield,

nice little addition I missed some times before.
No more need to make this if ... if ... if ... if ... "battles" ;-)

One question:
Is it a big deal to make $aItemClose and $aMenuClose as format strings like $ItemOpen and $aMenuOpen ?
Maybe it's a not very often needed thing, but I stumpled in some cases the last time, where it would be very helpfull.

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

brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #189 on: August 18, 2007, 10:35:36 AM »
Version 4.2 now available at http://code.jellycan.com/show_menu2/

    * Support for whitespace in conditional formatting
    * Support for boolean AND/OR with multiple tests in conditional formatting

e.g. It is now possible to use something like:
[if ( id == current || class == menu-expand ) { foo } ]

which will output " foo " for the current page or for menus with children. See
http://code.jellycan.com/sm2test/pages/conditional.php
for examples and as always the documentation for full details.

Quote from: BerndJM on August 15, 2007, 01:33:38 PM
Is it a big deal to make $aItemClose and $aMenuClose as format strings like $ItemOpen and $aMenuOpen ?

Yes. A lot of the information that is created for the opening items isn't available at closing time unless I stored it in a stack. I don't see that this should be necessary.

B
Logged

lleighh2

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #190 on: August 23, 2007, 10:59:24 PM »
I'm sorry but I'm just not getting this mod.

I've read through most of this thread and the jellycan sm2 documentation but i'm not a programmer so I just cook book it and copy what works for others.

So far I've been able to cook this up for my top horizontal menu here: http://www.theprocess.com/dev/wb//pages/rates.php.

Okay, I was really happy when I got the mod to show that. Trouble is this isn't what i want. I want the top menu to show a submenu of children only. Not a repeat of the main menu.  Please just alter my code below so that I can just copy it in place.

Code: [Select]
<?php show_menu2(0, SM2_ROOT, SM2_CURR+1, &#39;&#39;,&#39;[if(class!=menu){[a][menu_title]</a>}]&#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;); ?>
Here's a page that contains the submenu that i want to appear when you're on the voice talent page only:
http://www.theprocess.com/dev/wb//pages/female-voice-talent.php

I'm in the process of building the site. At least three other pages will have a unique submenu at the top.
Logged

brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #191 on: August 24, 2007, 01:30:28 AM »
Probably what you want. Lifted verbatim from the examples site:
http://code.jellycan.com/sm2test/

Root Level Only
show_menu2(0, SM2_ROOT, SM2_START);

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);

Probably what you do NOT want. Anything that has [if...] embedded in it.

Have fun.
Logged

lleighh2

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #192 on: August 24, 2007, 01:54:05 AM »
Quote from: brofield on August 24, 2007, 01:30:28 AM
Probably what you want. Lifted verbatim from the examples site:
http://code.jellycan.com/sm2test/

Root Level Only
show_menu2(0, SM2_ROOT, SM2_START);

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);

Probably what you do NOT want. Anything that has [if...] embedded in it.

Have fun.

I've been looking over that jelly can site for literally hours and made no sense of it. I'm sorry, just not structured in a way that worked for me.

I changed my code to this:
Code: [Select]
show_menu2(0, SM2_ROOT+1, SM2_CURR+1) ... just like you said but I only get the children to show in the left side menu not at the top like I want them.

... EDIT ...
Hold the phone! I just discovered that part of the problem was that I had the submenu items set to something other than the Main menu. So now, I'm very close. I'll keep tinkering.

Thanks for your help!!
« Last Edit: August 24, 2007, 01:59:17 AM by lleighh2 »
Logged

lleighh2

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #193 on: August 24, 2007, 04:14:51 AM »
Don't mean to be a pest/hog but i'm on a tight turnaround.

How do i pull my menu-current class from my css? It places a bg image behind the current menu item.

This is what I have so far:
Code: [Select]
<?php show_menu2(0, SM2_ROOT, SM2_START, 

&
#39;<ul>&#39; , &#39;<li class="menu">[a][menu_title]</a>&#39;, &#39;</li>&#39; , &#39;</ul>&#39;, &#39;&#39;, &#39;&#39;); ?>
   
Logged

brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #194 on: August 24, 2007, 04:23:13 AM »
Why do you think that I should care what sort of turnaround you are on.

I've already spent uncounted hours writing decent documentation and samples. Look at these things that have been written before. Play with parameters and look at what HTML source is generated by the function if you can't figure it out otherwise (try using the SM2_PRETTY flag to make it easier to read). Use your own initiative and not my time.

<style type="text/css"> .menu-current { background: url(big-arse-picture); } </style>
<?php show_menu2(0, SM2_ROOT, SM2_START); ?>
Logged

lleighh2

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #195 on: August 24, 2007, 11:04:53 AM »
@brofield So sorry for upsetting you or for suggesting that my time was more important than yours. I just don't understand the documentation or the examples and i thought that since everyone else on this thread seems to be getting it and i'm not then i could draw on the collective success of you all. please forgive my faux pas. and thank you so much for your help.

btw. that's exactly what i've had in my css all along. not sure why it's not working. i try not to won't bother you again.
Logged

nickleermans

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #196 on: August 29, 2007, 09:45:23 AM »
Quote from: nickleermans on April 28, 2007, 02:20:43 PM
I've tried many combinations of the code but I can't find the right one.

I have the following:

Topic 1
- Sub Topic 1a
- Sub Topic 1b
- Sub sub Topic 1ba
Topic 2
- Sub Topic 2a
- Sub Topic 2b
- Sub sub Topic 2ba
- Sub sub Topic 2bb

What I want is:

When you are in one of Topic 1's Children (Sub Topic 1a, - Sub Topic 1b or Sub sub Topic 1ba) then I want the menu to show all of the children of 1.

When you are in one of Topic 2's Children (Sub Topic 2a, - Sub Topic 2b, Sub sub Topic 2ba or Sub sub Topic 2bb) then I want the menu to show all of the children of 2.

The result has to be that there are 2 menu's: one with all the children (and sub children) of Topic 1 and one with all the Children (and sub children) of Topic 2.

I hope that someone know what I mean and have an answer!  :-D


This is my original post. And this is an answer:

Quote from: kweitzel on April 28, 2007, 06:37:24 PM
read the documentation of show menu 2 and make the relevant page_ids the starting point.

I found out that with this:
Code: [Select]
show_menu2(0, 1, SM2_ALL, SM2_ALL); I can replace the second number (=1) with the number of the root. But how can I change this number when the menu is changing?

Can anyone find an answer to my original question?
Logged

brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #197 on: August 29, 2007, 12:52:46 PM »
Version 4.3 now available at http://code.jellycan.com/show_menu2/

  • Support for a new flag, SM2_BUFFER. This turns on internal buffering of menu HTML which is then returned from the show_menu2() function allowing easy post processing of the output.
  • Support for a new flag, SM2_CURRTREE. This limits the output to only menu items that exist in the same rooted menu tree as the current page.

See the new examples at the SM2TEST website:
"Tree rooted at parent item" showing use of the SM2_BUFFER flag
"Current Tree Only" showing use of the SM2_CURRTREE flag

http://code.jellycan.com/sm2test/pages/enterprise/cogs-wheels/cogs/little.php

nickleermans: use the SM2_CURRTREE flag as in the example.

B
Logged

brofield

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #198 on: September 06, 2007, 02:48:14 PM »
Version 4.4 now available at http://code.jellycan.com/show_menu2/

  • Support for a new flag, SM2_ESCAPE to turn on HTML escaping of output. Shouldn't be needed, but just in case.
  • Deprecated use of SM2_NOESCAPE and made it the default, since the latest version of WB escapes the strings before adding them to the DB.
Logged

spida

  • Guest
Re: show_menu2: valid XHTML and CSS selectable menus
« Reply #199 on: September 06, 2007, 06:22:48 PM »
Quote from: kweitzel on April 28, 2007, 06:37:24 PM
Easiest way ... make 2 menu's (look for multiple menu in forum). Use standard menu call in template, just calling the menu numbers.

Hi Klaus and all,

I used the search for "multiple menu" but didn't find quite what I am looking for, thus I just ask here:
I have this site with three menus:
1. is the main navigation
2. is the subnavigation of second level pages
3. is supposed to be a service navigation with links to contact page etc.

I have it in index.php like this:
Mainnavigation:
Code: [Select]
<div id="navigation">
            <?php show_menu2(0, SM2_ROOT, SM2_START);?>
            </div>
Subnavigation:
Code: [Select]
<div id="rechtespalte">
            <?php show_menu2(1,SM2_ROOT+1, SM2_START);?>
            </div>
Service navigation:
Code: [Select]
<div id="metanav">
            <?php show_menu2(2, 19, SM2_ALL, SM2_ALL);?>
            </div>
My info.php says:
Code: [Select]
$menu[1]='Hauptnavigation';
$menu[2]='Subnavigation';
$menu[3]='Metanavigation';
and multiple menus is enabled in the admin.
Main and sub navigation both work properly, but pages I assign "Metanavigation" to in the page's prefernces are simply not shown in any of the menus.

I also tried
Code: [Select]
$menu[0]='Hauptnavigation';
$menu[1]='Subnavigation';
$menu[2]='Metanavigation';
in the info.php with the same negative results.

The navigations' "physical" order in the html is:
meta navigation first
then main menu
and after that sub menu

... don't know whether this is of relevance.

Obviously I have still not understood the menu2 stuff completely and would some help appreciate very much.

Thanks in advance,
Ayshe
Logged

  • Print
Pages: 1 ... 6 7 [8] 9 10 ... 13   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • show_menu2: valid XHTML and CSS selectable menus
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2