Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 05:50:05 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149667 Posts in 21100 Topics by 7538 Members
Latest Member: ionline
* Home Help Search Login Register
Pages: 1 ... 10 11 [12] 13   Go Down
Print
Author Topic: show_menu2: valid XHTML and CSS selectable menus  (Read 99475 times)
BerndJM

Offline Offline

Posts: 1764



« Reply #275 on: February 20, 2009, 09:11:16 PM »

Hi,

it's 'cause you format the .menu a:link, .menu a:visited, .menu a:active  with display: block in your screen.css

Regards Bernd
Logged

In theory, there is no difference between theory and practice. But, in practice, there is.
Peter R

Offline Offline

Posts: 17


« Reply #276 on: February 20, 2009, 09:42:18 PM »

Thanks for the fast response.
I have no idea what the block was doing there. It was in the template I started with.
To be honnest, I don't even knew block excised.

Got it working now.
Thank again!
Logged
hexa86

Offline Offline

Posts: 3


« Reply #277 on: March 08, 2009, 11:33:36 PM »

Hi guys, hi community,

I really appreciate your work on show_menu2, and I just use it while creating a website with website baker but I have one simple question:

I just read your documentation about it, but I was wondering if/how it is possible to address every single generated menu entry for itself. Sorry, if you don't understood me, but English is a foreign language for me Sad

Why do I need this? I just want to give every entry a different color with CSS. But I have no clue how to adress the generated entries.

I use the template called "module_finder" and that's my relevant code snippet out of it:

Code:
<div id="nav">
            <?php show_menu2(0SM2_ROOTSM2_ALL, ( SM2_ALL SM2_NUMCLASS), '<li><a href="[url]" class="[class] navlev[level]">[menu_title]</a>'"</li>"'<ul class="ullev[level]">'"</ul>"true'<ul id="header_menu" class="menu">');
            
//show_menu2(0, SM2_ROOT, SM2_ALL, ( SM2_ALL | SM2_NUMCLASS), false, "\n</li>", false, false, false, '<ul id="header_menu" class="menu">'); ?>
<br style="clear:left;"/>
        </div><!-- end nav -->

at the moment I only adress all generated entries with #nav in my external css-file, because I do not know how to adress them seperately.

I'd really appreciate your help, and I hope you can tell me whether this is possible or if it is possible a different way. Thank you in advance!

greets
christoph
Logged
brofield

Offline Offline

Posts: 224


WWW
« Reply #278 on: March 09, 2009, 03:34:30 AM »

I just added this entry to the FAQ. Does that help you?

http://code.jellycan.com/files/show_menu2-README.txt
Q:  How do I use a different class/picture/color/widget for each entry in a menu?

B
Logged
hexa86

Offline Offline

Posts: 3


« Reply #279 on: March 09, 2009, 11:19:10 AM »

Thanks for your really fast reply. That's real SUPPORT, man. I just took a short look at it, but after work I will check it out in detail, it really looks the way I can use it however.

You made my day.
Logged
WebBird
Guest
« Reply #280 on: March 30, 2009, 03:47:44 PM »

Hi,

show_menu2 is great, but not very easy to use. So, I thought about something like a backend, or even a "code generator". You may think of it as a "Wizard" where you make some choices an get the correct SM2 code to use.

Would that be something of interest?
@brofield: Would you be interested in helping me doing this? grin I would do the "backend" or "generator", but I'm sure I need help in some cases. rolleyes
Logged
virgil

Offline Offline

Posts: 177



« Reply #281 on: March 30, 2009, 04:07:42 PM »

... show_menu2 is great, but not very easy to use. So, I thought about something like a backend, or even a "code generator". You may think of it as a "Wizard" where you make some choices an get the correct SM2 code to use.
Would that be something of interest?

oh yes yes yes, please!  rolleyes

so long
virgil
Logged

Virgil - the pre-baked-stuff baker -   wink)
brofield

Offline Offline

Posts: 224


WWW
« Reply #282 on: March 31, 2009, 02:03:26 AM »

I'm not interested but knock yourself out. That is what I built the demo site for.
http://code.jellycan.com/sm2test/pages/time/procrastination.php
Logged
WebBird
Guest
« Reply #283 on: March 31, 2009, 08:47:25 AM »

I know that site, but I hear very often that people have problems using show_menu2 all the same. (Me, too, though I'm a developer. I took some answers from the module's code, but most people can't do that.)
Logged
Xagone
AddOn Development
*
Offline Offline

Posts: 453



WWW
« Reply #284 on: April 02, 2009, 01:23:27 AM »

i've search and cant fond that ...

how can i identify my base root parent ?

i've got 2 languages

in hierarchy

french
-home
-stuff
-- substuff
english
-home
-stuff
-- substuff

how can i do something like "if this menu is my base parent, do not show it" so that when in french, only english shows, and in english only french shows... ?

right now I use :
Code:
show_menu2(2, SM2_ROOT, SM2_START, SM2_ALL,'<a href="[url]" target="[target]" class="home">[menu_title]','</a>','','');
« Last Edit: April 02, 2009, 01:35:28 AM by VotreEspace » Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
BerndJM

Offline Offline

Posts: 1764



« Reply #285 on: April 02, 2009, 03:21:18 AM »

hi Espace,

at a first hint:
your root is french / english that you wont to display
so your startlevel is SM2_ROOT + 1

Hope I understand your question right ....

Regards Bernd
« Last Edit: April 02, 2009, 03:35:38 AM by BerndJM » Logged

In theory, there is no difference between theory and practice. But, in practice, there is.
Xagone
AddOn Development
*
Offline Offline

Posts: 453



WWW
« Reply #286 on: April 02, 2009, 01:12:20 PM »

Nope, doesnt do the trick, thanks for the help.

what i want

when in french, show the menu "english"
when in english, show the menu "french"
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
brofield

Offline Offline

Posts: 224


WWW
« Reply #287 on: April 05, 2009, 12:31:26 PM »

Easier to just hardcode that sort of menu, but if you really want to do it then show just the top level menu (see "root"). Then add conditional formatting to exclude the current menu item (2).

(1) http://code.jellycan.com/sm2test/#root
(2) http://code.jellycan.com/sm2test/pages/conditional/show-only-siblings.php
Logged
Xagone
AddOn Development
*
Offline Offline

Posts: 453



WWW
« Reply #288 on: April 05, 2009, 01:30:28 PM »

thanks brofield... but, already tried and missed.

that's why I asked... i think i'll go with php something like this :

if (page language is french) then {show english menu} else {go with french}
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
vanbemmel

Offline Offline

Posts: 22


« Reply #289 on: April 06, 2009, 05:04:15 PM »

Hi, i use showmenu2 on a site where i display only subitems with this tag:

<?php
show_menu2(
    $aMenu          = 0,
    $aStart         = SM2_ROOT+1,
    $aMaxLevel      = SM2_CURR+1,
    $aOptions       = SM2_TRIM,
    $aItemOpen      = '<a href="[url]" target="[target]" [if(level==1){ class="nav"}][if(level==2){ class="sub"}]>[if(level==2){- }][menu_title]</a>',
    $aItemClose     = '',
    $aMenuOpen      = '',
    $aMenuClose     = '',
    $aTopItemOpen   = false,
    $aTopMenuOpen   = false
    )
?>           

But when you're on a hidden page the subitems of that page are not displayed in the menu either.
When i change the current page to "not hidden" the submenu's are displayed well.\

Is it possible to change this code so submenu's are also displayed on hidden pages ?

Thank you.
Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #290 on: April 06, 2009, 05:11:47 PM »

 I am not a coder, but based on my experience with WB, SM2 can not see hidden pages, if they are shown in menu, then they are not hidden, right Smiley))) and if SM2 can not see them, it can not create submenu Tongue correct me if i m wrong Smiley
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
brofield

Offline Offline

Posts: 224


WWW
« Reply #291 on: April 07, 2009, 01:27:35 AM »

http://code.jellycan.com/sm2test/pages/parent/hidden-kids.php#currchild
This page is a hidden page that has children. Those children are shown correctly, see the test "currchild".

I guess the problem is you use of SM2_ROOT + 1 as the start. SM2 won't traverse through the hidden page to show the children. It doesn't even store information about hidden pages at the moment. It could be fixed to do so, but don't hold you breath waiting.
Logged
brofield

Offline Offline

Posts: 224


WWW
« Reply #292 on: April 08, 2009, 09:07:04 AM »

Ok. I take that back, it is a bug. Fixed in version 4.8.
Download at http://code.jellycan.com/show_menu2/

See output with the following hidden pages:
http://code.jellycan.com/sm2test/pages/parent/hidden-nokids.php
http://code.jellycan.com/sm2test/pages/parent/hidden-kids.php
http://code.jellycan.com/sm2test/pages/parent/hidden-kids/child2.php

Cheers,
B
Logged
scottm52

Offline Offline

Posts: 12


« Reply #293 on: May 06, 2009, 09:04:11 PM »

Having a coding quandry...  Have used show_menu2 with alot of sites.  But this time a customer haded over a template that is very convoluded and complex.  And the css is damned near unreadable.

But, I have show_menu2 doing it.  Cool.  With a noted exception..  not so cool, and hence the question.

They're governing the highlighting of athe current page with a unique page id  Which I can discover programmatically with SM2 pretty easily.

Code:
<?php show_menu2(0SM2_ROOTSM2_ALL'<li>[a] [if(id=current){id="current_tab"}] [menu_title] [/a]</li>'); ?>

Now if you look close that call just won't work.  But how would I set a hard id with an evaluation like this?

THX
Logged
scottm52

Offline Offline

Posts: 12


« Reply #294 on: May 07, 2009, 02:21:51 AM »

Having a coding quandry...  Have used show_menu2 with alot of sites.  But this time a customer haded over a template that is very convoluded and complex.  And the css is damned near unreadable.

When in doubt..  change the code...  I went with the more sturctured call and it made it tons easier to debug...

<?php show_menu2(
    $aMenu          = 0,
    $aStart         = SM2_ROOT,
    $aMaxLevel      = SM2_ALL,
    $aOptions       = SM2_TRIM,
    $aItemOpen      = '<li><a href="[url]" id="[if(id==current){updates_tab}]"> [menu_title] [/a]',
    $aItemClose     = '</li>',
    $aMenuOpen      = '<ul id="tabMenu">',
    $aMenuClose     = '</ul>',
    $aTopItemOpen   = false,
    $aTopMenuOpen   = false
    )
?>

Logged
Stefek
WebsiteBaker Org e.V.

Online Online

Posts: 4755



« Reply #295 on: June 11, 2009, 07:52:27 PM »

Dear Brofield.

I just updated the show_menu2 on one of my Websites and had to downgrade again.
It has to do with the "bugfix" described on your Homepage:

History
4.8 (8 Apr 2009)
Fixed output of menu when a hidden page is the current or parent page.
While this was declared as a Bug, I used it as a Feature - several times.

My question regards to a kind of fallback, if one still wants to "hide" all pages which are marked as "hidden" in the backend.
Is there a parameter for the $aOptions-Call I may use to achieve this?

I still want to use this as a Feature where this is appropriate to my design needs.

Kind regards,
Stefek
« Last Edit: June 11, 2009, 07:54:54 PM by Stefek » Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
brofield

Offline Offline

Posts: 224


WWW
« Reply #296 on: June 12, 2009, 01:11:36 AM »

Hi Stefek,

The fix that I put in should be what most people are after.

The menu item "Parent" that you can see in the full menu here:
http://code.jellycan.com/sm2test/pages/parent.php#full

Has a number of hidden children that can only been seen if you are displaying the hidden page.
http://code.jellycan.com/sm2test/pages/parent/hidden-kids.php#full

This is usually done via a reference to that page id directly, using it as the root.
http://code.jellycan.com/sm2test/#hidden

Would you describe what your problem is for me and how it differs from this usage? Short examples are always good.

B
Logged
amitmalka

Offline Offline

Posts: 28


« Reply #297 on: July 02, 2009, 05:02:24 PM »

how i  do like udm but that work ....with the showmenu2
Logged
vanbemmel

Offline Offline

Posts: 22


« Reply #298 on: July 23, 2009, 03:46:51 PM »

How can I display show_menu2 at a (non WB) php page?

I have a site that consist of WB and normal php pages.
Now I would like to display the WB menu also at those php page dynamically.

Any help would be appreciated.
Logged
bupaje

Offline Offline

Posts: 519


WWW
« Reply #299 on: July 23, 2009, 03:56:31 PM »

I had some non WB php pages I put the menu in previously. In my case I created a page called inserts and then put menus and other dynamic elements  as subpages. I made them hidden and used a blank template

+inserts/
 -menu
 -news

then I used an include statement to call these into the non WB pages.
« Last Edit: July 23, 2009, 03:58:58 PM by bupaje » Logged

My Blog, My Site
Pages: 1 ... 10 11 [12] 13   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!