Welcome, Guest. Please login or register.
March 16, 2010, 04:35:04 PM

Login with username, password and session length
Search:     Advanced search
WB 2.8.1 veröffentlicht!
Download und weitere Informationen gibt es hier .
110108 Posts in 15906 Topics by 9274 Members
Latest Member: someWBUser
* Home Help Search Login Register
+  WebsiteBaker Community Forum
|-+  English
| |-+  Templates, Menus & Design (Moderators: Argos, BerndJM)
| | |-+  show_menu2: valid XHTML and CSS selectable menus
Pages: 1 ... 7 8 [9] 10 11 ... 13 Go Down Print
Author Topic: show_menu2: valid XHTML and CSS selectable menus  (Read 76720 times)
brofield

Offline Offline

Posts: 224


WWW
« Reply #200 on: September 06, 2007, 06:37:59 PM »

If I understand you correctly, you want to have
1) root level menu
2) child menu
3) an unrelated utility menu.

In this case I would dispense with the whole multiple menu mess, and instead create your menu as normal. In this menu, add a top level hidden item "Utility Menu" and then add all of the utility menu items underneath it. Then make the 3rd call to show_menu2 using that hidden menu item as the root.

i.e. See the sample page at http://code.jellycan.com/sm2test/
These are your menus.
1. Root Level Only
2. Children/Siblings
3. Hidden Menu

B
Logged
ms

Offline Offline

Posts: 1


« Reply #201 on: September 07, 2007, 01:26:27 PM »

Hi,

I have a difficult question. I want to generate a menue with some graphical elements - different for each level - see here:



The black lines show the different (background)  images.

Is it possible and how can I do this with show_menu2?
Any help would be fine.

Thank You an best wishes

Mathias
« Last Edit: September 07, 2007, 01:28:04 PM by ms » Logged
brofield

Offline Offline

Posts: 224


WWW
« Reply #202 on: September 08, 2007, 04:00:00 AM »

Yes. Learn HTML and CSS and go for your life.

First create it yourself in straight HTML. Once you know how to do it,
you then automate it with a menu function like SM2.
See the documentation for what CSS classes SM2 creates.

B
Logged
spida

Offline Offline

Posts: 201


« Reply #203 on: September 13, 2007, 02:41:11 PM »

If I understand you correctly, you want to have
1) root level menu
2) child menu
3) an unrelated utility menu.

In this case I would dispense with the whole multiple menu mess, and instead create your menu as normal. In this menu, add a top level hidden item "Utility Menu" and then add all of the utility menu items underneath it. Then make the 3rd call to show_menu2 using that hidden menu item as the root.

i.e. See the sample page at http://code.jellycan.com/sm2test/
These are your menus.
1. Root Level Only
2. Children/Siblings
3. Hidden Menu

B


Hi Brofield,

tx for the explanation. I discarted the multiple menu stuff and now have simply three calls for show_menu2 in the code, just as you suggested.
I actually didn't need to change the calls for the main navigation and the menu with its children. The only thing I still don't understand (despite reading your documentation a couple of times) are the variables you use for the hidden menu:
show_menu2(0, 19, SM2_ALL, SM2_ALL), e.g. what is the 19 referreing to?

This menu is still not displayed, thus I would like to understand how the script works to get it work. smiley

Thank you in advance for some further assistance,
regards,
Ayshe
Logged
brofield

Offline Offline

Posts: 224


WWW
« Reply #204 on: September 14, 2007, 03:30:08 AM »

It is the page ID for the parent item. Note that this item will not be displayed, only it's children will. You get this number by logging into the admin, clicking on the page that you want to be the parent as though you are going to edit it, and then reading the number out of the address bar.

e.g.
Login
Pages
click page you want as parent
address bar =
http://code.jellycan.com/sm2test/admin/pages/modify.php?page_id=19
The page_id is 19
put this into the show_menu2 call as the parent.

B
Logged
spida

Offline Offline

Posts: 201


« Reply #205 on: September 19, 2007, 08:44:24 AM »

Thank you, Brofield. You rock!  afro
Logged
deeve007

Offline Offline

Posts: 75


WWW
« Reply #206 on: October 03, 2007, 09:29:35 PM »

This menu won't show normally because of the invisible parent. However, you can show it in your template where-ever you want by specifying the ID of the invisible parent:
<?php show_menu2(1, **INVISIBLE_PAGE_ID**, SM2_ALL, SM2_ALL); ?>

Okay, got my utility menu displaying great with this code. Now my issue is with the breadcrumbs, which show the "hidden" parent page of the utility pages.

I'm using show_breadcrumbs() to display the breadcrumbs. Is there any way to have the breadcrumbs show a link to the Homepage followed by the name of the current utility page, but NOT show the hidden utility parent?

Thanks
Logged

www.offusion.com - Website/print design & development | www.michezoyouth.co m - Kenyan youth sports project
brofield

Offline Offline

Posts: 224


WWW
« Reply #207 on: October 04, 2007, 01:14:03 AM »

Use show_menu2 to show the breadcrumbs.  Add a link to the top menu manually.
See http://code.jellycan.com/sm2test/pages/oompa.php which is a page of a hidden
utility menu. Then look for "breadcrumbs". Copy and modify the code as necessary.

B
Logged
deeve007

Offline Offline

Posts: 75


WWW
« Reply #208 on: October 04, 2007, 10:59:49 AM »

The breadcrumb code wouldn't show anything. I have show_menu2() working fine, but when using the following code absolutely nothing is displayed:

show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB, '<span class="[class]"> > [a][menu_title]</a>', '</span>', '', '', '<b>You are here:</b> <span class="[class]">[a][menu_title]</a>');

Anyway, have decided to use echo PAGE_TITLE, very simple, to show where I am.

Next issue: I can't see anywhere that shows it possible to assign a class to each individual menu item, in case you want to use an image for each menu item. Easy to assign a class to a menu level, but is it possible to assign for each actual menu item?

And if not, I would suggest this as a fairly important addition to be made.
« Last Edit: October 04, 2007, 11:02:12 AM by deeve007 » Logged

www.offusion.com - Website/print design & development | www.michezoyouth.co m - Kenyan youth sports project
brofield

Offline Offline

Posts: 224


WWW
« Reply #209 on: October 05, 2007, 01:10:44 AM »

Use the page id. i.e. class="page_[page_id] [class]"

B
Logged
lanesharon

Offline Offline

Posts: 47


WWW
« Reply #210 on: December 13, 2007, 02:13:50 PM »

Brofield,  You might want to remove the references to the udm4 menu, since you are releasing your show_menu2 product as GPL.  udm4, per their website - "is not open-source or public domain software".  Read the rest here:
http://www.udm4.com/licensing/terms/

I have a menu that I use on another website that uses the popout feature.  You may want to look here for it:
http://www.xs4all.nl/~peterned/
« Last Edit: December 13, 2007, 07:31:02 PM by lanesharon » Logged

Take Care,  Sharon
masarin

Offline Offline

Posts: 34


« Reply #211 on: March 11, 2008, 05:04:01 PM »

I am making my first WB Template and want it to be valid XHTML Strict.

When validating the template I get the error: there is no attribute "target"

The "<?php show_menu2(); ?>" prints the menu items like this:

<ul class="menu-top">
<li class="menu-sibling menu-first">
<a href="http://mysite/wb" target="_top">Hem</a>
</li>
</ul>

Q:
Is there a way to make show_menu2 print the "<a>" tags without the "target=" attribute?
Logged
doc

Offline Offline

Posts: 3579


« Reply #212 on: March 11, 2008, 05:35:29 PM »

Hello,

yes this is possible with the show_menu2 code snippet. Please read the documentation of the developer which explains what parameters you need to change (section FORMAT STRINGS).

Regards Christian
Logged
masarin

Offline Offline

Posts: 34


« Reply #213 on: March 11, 2008, 08:44:40 PM »

Tnx.

Uhh, thats hard reading for a non PHP programmer, but I managed to come up with this that's vaidates as XHTML Strict:

Code:
<?php show_menu2(0SM2_ROOTSM2_CURR+1SM2_PRETTY'[list][li]<a href="[url]">[menu_title]</a>'); ?>


I then tried to add some other parameters like "SM2_MAX+1" to limit the menu to two levels (root an one sublevel) but then the whole menu disappeared. So I don't really understand the syntax here, it was just luck.

Guess I have to read the documentation a few times more then..
« Last Edit: March 12, 2008, 11:08:00 AM by masarin » Logged
kozmoz

Offline Offline

Posts: 33


WWW
« Reply #214 on: March 13, 2008, 12:24:21 PM »

We had a little issue with our menu.

When we displayed a page that was at the second level of the menu, suddenly all of its sibling items disappeared. Opening a child at the third level reveals the menu items again.

Now in the sm2_recurse() function I have added an extra check.
This fixed the bug we had, but I'm not sure if it's done right:

in include.php:
Code:
        else if ($aFlags & SM2_TRIM) {
            // parents and siblings of parents
            // Always show the siblings
            if (!array_key_exists('sm2_is_sibling', $page)
                && !array_key_exists('sm2_on_curr_path', $page)    // not set if false, so existence = true
                && !array_key_exists('sm2_path_sibling', $page)) {  // not set if false, so existence = true
                continue;
            }
        }
Logged
brofield

Offline Offline

Posts: 224


WWW
« Reply #215 on: April 01, 2008, 03:47:57 PM »

kozmoz ->
How is your menu different to the test site? The following page is a second level menu with children. I don't see the same problem.
http://code.jellycan.com/sm2test/pages/enterprise/cogs-amp-wheels.php

Not saying that you haven't found a bug. Just clarifying.

B
Logged
brofield

Offline Offline

Posts: 224


WWW
« Reply #216 on: April 10, 2008, 06:35:59 AM »

A little cleanup and re-release of Thorn's 4.41 version as 4.5. This has support for WB 2.7 (but maintains support for 2.6.7 still). Source repository is now available at http://code.google.com/p/showmenu2/

See http://code.jellycan.com/show_menu2/ for the download.

Tested with 2.6.7 but not with 2.7
Let me know if there are problems with 2.7
Logged
doc

Offline Offline

Posts: 3579


« Reply #217 on: April 10, 2008, 07:14:10 AM »

Thanks Brofield,

added your new version to the addons repostiory.

Regards Christian
« Last Edit: April 11, 2008, 08:01:06 PM by doc » Logged
doc

Offline Offline

Posts: 3579


« Reply #218 on: April 13, 2008, 09:35:34 AM »

Hello,

thanks to BerndJM, we have now a German README file for the show_menu2() code snippet. The German README_DE is included in the lateste code snippet version v4.50 on the Addons repository.

Bernd, thanks for this contribution, pretty sure many people out there will like it  smiley

Regards Christian
Logged
Boudi

Offline Offline

Posts: 497


//o_-\\


« Reply #219 on: April 17, 2008, 09:18:55 AM »

Hello,

Recently I noticed a 'bug'? in the show_menu2 function along with the WB search function. When doing a search the menu dissapears. This only happens with multilanguage websites.

Example: go to the HELP page on this WB site and do a search; the vertical menu dissapears after the search. This is the exact problem that I'm facing for the last month when building my own multilanguage website.

See thread: http://www.websitebaker2.org/forum/index.php/topic,9206.msg55182.html#msg55182

My question is if there are more users who are formiliair with this issue? I already notified sir Brofield regarding this behaviour and hope that he can help me/us in this matter.

Sincerley
Knert
Logged

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

Offline Offline

Posts: 3579


« Reply #220 on: April 17, 2008, 10:21:01 AM »

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
Logged
Boudi

Offline Offline

Posts: 497


//o_-\\


« Reply #221 on: April 17, 2008, 03:15:59 PM »

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  undecided

Sincerly,
Knert

Logged

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

Offline Offline

Posts: 3579


« Reply #222 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
Code:
<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.
Code:
<input type="hidden" name="referrer" value="<?php echo defined('REFERRER_ID')?REFERRER_ID:PAGE_ID;?>" />

Brofield thanks for this bugfix.

Regards Christian
« Last Edit: April 22, 2008, 09:17:33 PM by doc » Logged
bupaje

Offline Offline

Posts: 473


WWW
« Reply #223 on: May 09, 2008, 09:35:55 AM »

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.

Code:
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.

Logged

brofield

Offline Offline

Posts: 224


WWW
« Reply #224 on: May 10, 2008, 10:11:27 AM »

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
Logged
Pages: 1 ... 7 8 [9] 10 11 ... 13 Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!