show_menu2: valid XHTML and CSS selectable menus

brofield

Final beta release before final release of 3.0

Following are the changes:
[ul]
[li]Argument list has had final change. Now uses itemOpen, itemClose, menuOpen, menuClose like existing show_menu.
[li]Classes are not added automatically to tags anymore. You must designate the tag to receive the class by adding the [class] keyword. Note that this is different to show_menu in that it doesn't add class="", only the class list. Therefore use something like, '<ul class="[class]">'.
[li]Added the [class] keyword, as well as [li] and [ul] for the standard item and menu open tags.
[li]Using UDM4 for the popup menu demo on the test site
[/ul]

See http://code.jellycan.com/show_menu2/ for download and readme file.

Note that version 3.0 of show_menu2 can be used by other functions to recurse through tree for them and make use of the cached data and single SQL query. See legacy.php file for examples of how this is done (call show_menu2 from inside your own function and supply your own formatter class).

If there are no bugs or changes required, this will be the 3.0 version.
Brodie

brofield

Seems I have nothing better to do. Quick release of beta 7. See http://code.jellycan.com/show_menu2/
Doco updated. Flag for the top menu (SM2_TOPMENU) removed. If you supply a top menu item then it is used verbatim.
Should work with UDM4. Back to you Stuart...

B

succhi

#93
Hi All, next update should help everyone.

@virgil
Please note the following change for showing all menus. The SM2_MULTIMENU no longer works. SM2_ALLMENU is now passed as the first parameter (not as a flag) which is usually the menu number you want. The menu is cached as usual.

@phil
By default you will have access to two css classes at the start and end of each group of siblings. If you have put item tags in (eg <li>, <span> etc) you will get class="menu-first" and class="menu-last" to fine tune layouts that depend on different beginnings and endings. You no longer need to pass the SM2_FIRSTLAST flag, it is now default

@virgil, melissa
There is a new flag that supresses topMenuOpen from getting class="menu-top" being added to it. The second from last parameter is $aTopMenuOpen and this is where you can specify what you want your topmost element to be e.g. <div id="my-id" class="my-class"> or <ul  id="my-id" class="my-class"> etc. It over-rules the $aMenuOpen tag for use at the very top. However to stop menu-top from being added to the class you need to pass a new flag SM2_TOPMENU. You can now pass SM2_TOPMENU as a flag along with "<ul id='udm' class='udm'>" (for $aTopMenuOpen) and get only that at the top.

The new update is 3.0b6
Please let me know if there are any problems. Documentation will follow later when Brodie is back on board.

Stuart



[gelöscht durch Administrator]

virgil

OK guys I'm back... I can't leave you alone for a couple of hours, can I?...  :roll:
... and you are overhelming me with information... Ill'try to digest it! :|

Quote(from Matthias)
"Sitemap v.2.8 supports the following informations wich you easily can use at the place you want."

"I like the show_menu2 because it is fast (only on database request) and flexible for all things that are needed."

(from Brodie)
"If you do want to use it then do the same as above replacing show_menu with
with show_menu2. To use sm2 with UDM see succhi's comment above.
http://forum.websitebaker.org/index.php/topic,2584.msg20067.html#msg20067"

(from Succhi)
"You're quite right about the whole sitemap thing. [...]"

@Matthias Brodie Succhi

Thanks a lot for your advice... I will have a look at the standard sitemap 2.8...
if it meets my need,.... I will switch back to standard show_menu
and standard sitemap.

I believe Brodie's show_menu2 beiing great, but for me, with my
limited knowledge... the regular menu + sitemap are more easy handle...  :wink:
nevermind, thx to you all!  :-D

Cheers
Virgil
Virgil - the pre-baked-stuff baker -   ;-))

brofield

To use sm2 with UDM you need to read this page, http://www.udm4.com/manual/setup/list/

At the moment sm2 always adds the "menu-top" class to the top level menu item. According to the page above, this causes problems. sm2 needs to be changed so that if a top level open is supplied using $aTopMenuOpen parameter, then we just use that string verbatim and don't add the menu-top class. Seems a reasonable assumption that if the user specifies the top level open tag then they can add whatever classes they need without sm2 meddling in it.

With that change, UDM can be used by calling sm2 with

$aTopMenuOption = "<ul id='udm' class='udm'>"
$aItemClose = "</li>\n"

Cheers,
Brodie

brofield

Quote from: succhi on May 08, 2006, 09:02:36 AM
I'm not actually stomping on $extra_where_sql, it is left as is in the original state or added to with the 'AND menu = $aMenu' part if required. So by default we get the 'AND menu = $aMenu' added however to select 'all menus' from a multimenu heirarchy I needed to remove the specific call the menu = $aMenu.

You can't modify it as it doesn't belong to sm2 and will be used by other functions in the template. Change your code so that the "AND menu = $aMenu" is a local variable. As you mentioned, get rid of the multimenu flag and have callers set $aMenu to SM2_ALLMENU instead. Define SM2_ALLMENU as -1. When $aMenu == SM2_ALLMENU then set the menu sql to empty so that all menus are returned. Ensure that the sorting is correct for this situation. Caching can stay as it is using -1. Alternatively we could just not cache the results of that call.

Quote from: virgil on May 08, 2006, 08:48:19 AM
... NOT your show_menu2  :oops:

Reason... I want to combine it with melissa's UDM4 capabilities, see...
http://forum.websitebaker.org/index.php/topic,2805.msg18740.html#msg18740

If you do want to use it then do the same as above replacing show_menu with
with show_menu2. To use sm2 with UDM see succhi's comment above.
http://forum.websitebaker.org/index.php/topic,2584.msg20067.html#msg20067

@ruebenwurzel
Neither of these changes are going to change the performance characteristics of sm2.

Regards,
B

ruebenwurzel

@virgil

QuoteI know... but I am fund of the additional possibilities of the sitemap with
description and keywords, what the original sitemap doesn't offer...

Sitemap v.2.8 supports the following informations wich you easily can use at the place you want.

Quote[PAGE_ID] - The page id of the specific page in the sitemap.
[PARENT] - The parent of the page that is currently in the loop.
[LINK] - The link to the specific page within the sitemap.
[PAGE_TITLE] - The title of the page within the sitemap.
[MENU_TITLE] - The title of the page as it is shown witin the menu.
[DESCRIPTION] - The description of the page within the sitemap.
[KEYWORDS] - The keywords that are given for the current page within the sitemap.
[TARGET] - The target to which the page should be opened.
[MODIFIED_WHEN] - The date when the page has been last modified.
[MODIFIED_BY] - The person who made the last modification to the specific page.

Look at the help of the sitemapmodul for more informations. We had a little problem with modified_when but there exists a fix wich is included in the next version.

@brofield
I like your show_menu2 because it is fast (only on database request) and flexible for all things that are needed. Keep it in this way and don't overload it with too much wich slows it down.

Matthias

succhi

@Brodie

You're quite right about the whole sitemap thing. I guess with the example found at your demo site people are going to want to shoehorn show_menu2 into doing sitemaps too as shown.

I'm not actually stomping on $extra_where_sql, it is left as is in the original state or added to with the 'AND menu = $aMenu' part if required. So by default we get the 'AND menu = $aMenu' added however to select 'all menus' from a multimenu heirarchy I needed to remove the specific call the menu = $aMenu.

What if with MULTIMENU we cached the menu with a menu number like -1 so that if a secondary call is made to show_menu2 it can't find the cached menu to match and will make the second call? This can be done internally so the parameter doesn't need to be passed this way. Or instead of including the $aMenu number desired which I left as 0 we could just pass the MULTIMENU constant there as -1.

e.g. show_menu2(SM2_MULTIMENU...

I think that looks better to me and fixes up the problem of mucking up the cached menu. Alternatively we just get people, as you suggested, to drop the usage of show_menu2 for sitemaps.

I'll fix the menu-first, menu-last bit.

Stuart.

virgil

Well, to be honest...

I enter in my index(.)php ...

show_menu(1, ....);
show_menu(2, ....);
show_menu(3, ....);

... NOT your show_menu2  :oops:


Reason... I want to combine it with melissa's UDM4 capabilities, see...
http://forum.websitebaker.org/index.php/topic,2805.msg18740.html#msg18740

QuoteWhy are you not using the sitemap module? show_menu2 is designed to
(wait for it) show menus. It is flexible enough to be able to abuse it and create
sitemaps, but it isn't the main purpose of the function.

I know... but I am fund of the additional possibilities of the sitemap with
description and keywords, what the original sitemap doesn't offer...

Cheers,
Virgil


Virgil - the pre-baked-stuff baker -   ;-))

brofield

Yes, so on your code page that you created for the sitemap, you enter...

show_menu2(1, ....);
show_menu2(2, ....);
show_menu2(3, ....);

Or does this end up with different results from what succhi's code displays?
Perhaps I still don't understand multiple menus correctly.

Why are you not using the sitemap module? show_menu2 is designed to
(wait for it) show menus. It is flexible enough to be able to abuse it and create
sitemaps, but it isn't the main purpose of the function.

B

virgil

Hi Brodie, welcome back

Quote from: brofield on May 08, 2006, 08:00:39 AM

... SM2_MULTIMENU: I don't see the use for this option.
As far as I am concerned you just make multiple calls to show_menu2,
once for each menu number that you want to display...

@virgil
why not just use multiple calls to show_menu2 as above?

QuoteFeel free to enlighten me...

... well, I give it a try: :roll:

I do NOT want to call for multiple menus... I WANT the sitemap to show ALL PAGES,
no matter which menu they are assigned to, but this did NOT WORK, until succhi's
SM2_MULTIMENU option. Let me try to explain again:

Lets say I have 2 menu blocks both independent from each other (menu1, menu2):
1.) one vertical menu on the left
2.) one horizontal top menu

When I place the sitemap menu link on the top menu, the sitemap shows only the
entries of the top menu, but not of the left menu. :-(

When I place the sitemap menu link on the left menu, the sitemap shows only the
entries of the left menu, but not of the top menu.  :-(

But I want, no matter where I place the menu link... tha the sitemap shows me ALL
PAGES of my site, no matter if they are assigned to the left or to the top menu...
and that's exactly what the SM2_MULTIMENU option made possible.  :-D :-D :-D

I hope I was able, despite my linkish english, to express what I mean!  :wink:

Cheers,
Virgil
Virgil - the pre-baked-stuff baker -   ;-))

brofield

#84
@succhi
Thanks for the updates while I'm travelling. See my comments below though.

re: SM2_MULTIMENU
I don't see the use for this option. As far as I am concerned you just make multiple calls to show_menu2, once for each menu number that you want to display. It isn't like the number of submenus that are used in a site changes regularly. Feel free to enlighten me as to why this would be a good feature to have.

@virgil
why not just use multiple calls to show_menu2 as above?

@succhi
You can't stomp all over the $wb->extra_where_sql member variable as I don't own it. You always want to use this SQL unchanged (to remove hidden, private, etc pages). Additionally, the results of the database query are cached using the menu number as one of the keys, so you can't do the query this way. The query is done only once on the first call to show_menu2 for that menu. You're current update will cause problems for subsequent menu displays if it was the first call. If it wasn't the first call then your changes won't help. Loading all of the menus into the in-memory cache at one time will require a larger rewrite than that. I can't do this at the moment (travelling), nor as mentioned above can I see a good requirement for it.

re: SM2_FIRSTLAST
@succhi
If you want to get rid of the SM2_FIRSTLAST flag so that all menus generate the classes for the first and last sibling of every list, then I'll make it a standard feature. However, please rename the class names to "menu-first" and "menu-last" to maintain consistency with all other class names. No arguments are required to change the class names - CSS selectors can be used to identify items in specific menus.

Regards,
Brodie

succhi

OK a quick update on show_menu2 to allow you to track the first and last siblings in a menu/submenu. All first items will have "class='first'" added to the item tags if available, vice versa last items. You will need to add the new flag SM2_FIRSTLAST as shown below.

If you would like to do something like

  Home | About | Contact Us

Try the following with the updated version

echo "<style> .rootnav span {border-left: solid 1px red; padding: 0 10px;} .rootnav span.first {border-left: none;} </style>";

show_menu2(0, SM2_ROOT, SM2_START, SM2_TRIM|SM2_DESCKEY|SM2_MULTIMENU|SM2_FIRSTLAST, '[a][menu_title][/a]',"<div class='rootnav'>",'</div>','<span>','</span>','',false);


The updated version I have moved on to 3.0b5. Brodie may modify this if he has a better way to acheive the same thing so please be aware of this when you use this updated version. For instance I have not wanted to change things too much but it might be nice to add some arguments so the naming for 'first' and 'last' can be manually changed. I'm trying to be light handed so Brodie can come back and do what he needs in checking the additions and if the additions are worth keeping.

Stuart

[gelöscht durch Administrator]

succhi

@virgil

You can already add what Melissa wanted using show_menu2. Near the end of the function call is the $aTopMenuOpen varibale and you can pass it '<ul id="udm" class="sitemap udm">' which gives the following only at the top <ul id="udm" class="sitemap udm menu-top">. You don't need the sitemap in there, I just wanted to illustrate the possibilities.

I'm still looking into the start and finish parts so that people can eventually do things like

Home | About | Contact Us

Or other really exciting layouts that need specific handling for start or end elements like borders or colours, images etc.

Stuart

succhi

#81
Hmmm...

I can certainly see from some other posts interest in being able to add css to the first and last element in a submenu/menu and also to the element just before a submenu (collapsed or otherwise) (update: already there as "class='menu-expand'"

<ul>
    <li class="first-li"></li>
    <li class="menu-expand">
    <ul>
        <li class="first-li"></li>
        <li></li>
        <li class="last-li"></li>
    </ul>
    </li>
    <li class="last-li"></li>
</ul>

I'm not sure I have the time and it really is Brodie's code so I don't want to stomp all over it. But I will have a look and see what I can find.

Personally I am looking for a way to do UDM4 style menus without having to pay. Nearly all the nice dhtml solutions are asking for money now. Understandable I guess because they need to stay on top of browser compatibility issues etc. If I code my own one up from scratch I can't actually test it on all browsers so I may just need to invest one day.

Stuart

virgil

@stuart

You guys are fantastic and I'm getting really gelous about your coding ability...
It works great  :-D :-D :-D

At the beginning of this topic I was wondering if I really will ever nedd this modul, but the longer
I think it's a great stuff. Im still plaing around with the standard show-menu for the navigation
itself as I am working on implementing udm4, wich seem to work properly with it.

This input was given to me by melissa in this topic:
http://forum.websitebaker.org/index.php/topic,2805.msg18740.html#msg18740


@brodie @stuart @all-php-pro's

Maybe, if you guy are willing to help out implementig UDM4 in show_menu2, this would,
I thing, boost template creation at new dimensions...

Cheers
Virgil

Virgil - the pre-baked-stuff baker -   ;-))

succhi

#79
Hey Virgil

It sounded like Brodie will be away from this for a short while so I'll send you an updated version (find attached) that I have modified to help you out. Just update the current one and add the new flag (as shown below) and it should work for you. I have updated the version to reflect a small change so that you can track which version you have so you can roll back if you need. Brodies latest is 3.0b3 so I have changed this to (3.0b4). I'm sure brodie will re-code this and bring out a proper 3.0b4 with a more elegant solution to the problem you are facing. Until then use this and see if it gives you your desired result.

I have tried it and it works on my small example.

You need to add an extra flag called SM2_MULTIMENU to your function call. For the snippet which adds the flag see below.

show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL|SM2_DESCKEY|SM2_MULTIMENU, ...

@brodie.
Can you have a look and see if this is OK and either keep this as 3.0b4 or rework it and re-release it. I haven't worked much with bitwise operators so I might have it wrong. It seems to work well but I'll let you be the judge.

I like how far your mods on it have come since you first released it. Well worth using I can see.

Cheers
Stuart

[gelöscht durch Administrator]

virgil

Hi Brodie
I'm here again... :roll:... with a new wish about the sitemap functionality of show_menu2...

As mentionned above, the stuff works great, except for this:

If I have a site with multiple menu, let's say:
1.) a regular multiple nested main menu on the left with almost all pages of the site, and
2.) a 'only first level' top menu (with the half dozen 'one-click-quick-access-important-pages')
3.) a menu for multilanguage switching
4.) and so on...

then I have the problem, that (logically) the sitemap shows only the pages included in the same
menu block. So this means:

When I place the sitemap (wich is an important page to me) on the top menu '2.)',
only the half dozen entries of this menu are displayed in the sitemap...
well, its' not really what a sitemap is meant to be... isn't it?

Now, how can I alter the entry of the code page the way that
no matter how many menu blocks I use in my template and
no matter in wich menu I place my sitemap link,
ALL PAGES are captured and followingly SHOWN in the sitemap?  :wink:
(like the regular sitemap function does...)

Thx for your reply
Regards,
Virgil
Virgil - the pre-baked-stuff baker -   ;-))

virgil

Well, Brodie, you know... there are times I really do not understand computers... this is one of those...  :? :? :?

Don't ask me why... it's hard to believe... I did exactly the same like before... but IT WORKS NOW!!!  :-D :-D :-D


QuoteNote that in my stuff the call to show_menu2 is all on one line.
... just only because I  this?  :?

Well, man ... thats really a great application (sitemap) to use your show_menu2 ...
exactly what I was looking for!

THX so much and Regards,
a very greateful Virgil
:lol:
Virgil - the pre-baked-stuff baker -   ;-))

brofield

Dunno, there is obviously something going wrong that is losing your ul tags. Try a copy and paste of this. Note that in my stuff the call to show_menu2 is all on one line.


show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL|SM2_DESCKEY, '<span class="stuff">[a][page_title][/a] (menu: [a][menu_title][/a])<br /><i>[description]</i><br />([keywords])</span>',"<ul class='sitemap'>",'</ul>','<li>','</li>',false,false);


This is the exact code that I am using on my test page. Note that I don't recommend putting the CSS into the code page like I am doing. I have only done it because I'm lazy and I wanted to work around the template style sheet. It should actually go in the template's style sheet.


echo <<<FOO
<style type="text/css">
div.left ul, div.left li, div.left span, div.left * {
    text-align: left !important;
}
ul.sitemap li {
    text-align: left;
    padding-top: 0.5em;
}
ul.sitemap .menu-current > span.stuff {
    display: block;
    background-color: #E0E0FF;
    border-right: 2px solid blue;
}
div.left { text-align: left !important; }
</style>
<h1>Sitemap</h1>
<div class="left">
FOO;

show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL|SM2_DESCKEY, '<span class="stuff">[a][page_title][/a] (menu: [a][menu_title][/a])<br /><i>[description]</i><br />([keywords])</span>',"<ul class='sitemap'>",'</ul>','<li>','</li>',false,false);

echo "</div>";


Ensure that you are using either 3.0b2 or 3.0b3 as the first release didn't have support for the description/keywords stuff. Note that if you are using show_menu2 multiple times on the page then you need to have the SM2_DESCKEY flag passed to it the very first time you call it otherwise you will get "0" for your description and keywords.

Good luck.

B

virgil

Hi Brodie

Thx for reply.

I've put ONLY this in a code page:

show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL|SM2_DESCKEY,
   '<span class="stuff">[a][page_title][/a] (menu: [a][menu_title][/a])'.
   '<br /><i>[description]</i><br />([keywords])</span>',
   "<ul class='sitemap'>",'</ul>','<li>','</li>',false,false);


... we're on the good run  :-D .... BUT  :x ...

I get the following now (EXACTLY what you see... Codes, but no content):
(BTW: the links [page_title] and [menu_title] are working correctly)

<
class='menu-top
'>< class='
menu-sibling'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
menu-sibling'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
menu-expand menu-sibling'>[page_title] (menu: [menu_title])
[description]
([keywords])<
class='
'>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
menu-expand'>[page_title] (menu: [menu_title])
[description]
([keywords])<
class='
'>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>>>>>< class='
menu-expand menu-sibling'>[page_title] (menu: [menu_title])
[description]
([keywords])<
class='
'>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>>>< class='
menu-sibling'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
menu-expand menu-sibling'>[page_title] (menu: [menu_title])
[description]
([keywords])<
class='
'>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>>>< class='
menu-expand menu-sibling'>[page_title] (menu: [menu_title])
[description]
([keywords])<
class='
'>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
menu-expand'>[page_title] (menu: [menu_title])
[description]
([keywords])<
class='
'>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>>>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>>>< class='
menu-expand menu-sibling'>[page_title] (menu: [menu_title])
[description]
([keywords])<
class='
'>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>>>< class='
menu-sibling'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
menu-expand menu-sibling'>[page_title] (menu: [menu_title])
[description]
([keywords])<
class='
'>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>>>< class='
menu-expand menu-sibling'>[page_title] (menu: [menu_title])
[description]
([keywords])<
class='
'>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>< class='
'>[page_title] (menu: [menu_title])
[description]
([keywords])>>>< class='
menu-current'>[page_title] (menu: [menu_title])
[description]
([keywords])>>



There must still be sme tiny mistake, but as I'm definitly not a coder... aehm... sorry... could you help once more?  :roll:
Sorry if I'm abusing you being so pacient.

Regards,
Virgil
Virgil - the pre-baked-stuff baker -   ;-))

brofield

Just put the call to show_menu2. You can't use <?php ?> in a code page.

B

virgil

@brofield


Hi again

Quote from: brofield on May 04, 2006, 02:59:31 PM
Instead of wysiwyg, choose Code for the page type.
Then write the call to show_menu2 directly into the page.

It's exactly what I did before posting my question (nice t see that I was on te right way)
but it doesn't work...  :|

I get:

Parse error: parse error, unexpected T_STRING
in /home/httpd/vhosts/mydomain.com/httpdocs/modules/code/view.php(30) : eval()'d
code on line 5


My entry in in the Code page was

<?php
 show_menu2
(0SM2_ROOTSM2_ALLSM2_ALL|SM2_DESCKEY
   '<span class="stuff">[a][page_title][/a] (menu: [a][menu_title][/a])'.
   '<br /><i>[description]</i><br />([keywords])</span>',
   "<ul class='sitemap'>",'</ul>','<li>','</li>',false,false);
?>


(BTW: After saving the page the   "<?php"   and the   "?>"   disappears; is this OK?)

What do I do wrong? :?

Thx for your reply
Regards,
Virgil
Virgil - the pre-baked-stuff baker -   ;-))

brofield

Release of show_menu2, version 3.0 beta 3.

Changes:

  • added trial support for legacy functions show_menu() and page_menu()

Details, demo and downloads at http://code.jellycan.com/show_menu2/

Currently these functions are named sm2_show_menu and sm2_page_menu so that I can test them side by side. See the bottom of the test page for some demos. Basically, it isn't working. I don't quite understand the results that I am getting out of show_menu. It seems like it is not rendering the menus like it's call signature says it should. If someone can have a look and give me comments on if the results I see there are what you expect. Perhaps a few more examples to work with.

However, there is never going to be 100% backward compatibility with those functions without keeping the existing code. I don't see why we don't just do that. Just add show_menu2 to the main distrib and encourage template writers to use it. If you want to get rid of the original functions in the future then do so.

In any case, this is the last release / bugfix for a few weeks. Enjoy.

Regards,
Brodie

brofield

Quote from: virgil on May 04, 2006, 02:09:33 PM
I guess that -to create a normal menu- you put a regular php-call of show_menu2
in the index(.)php file, which will create the menu call on every page of your site
... but...
I want a sitemap to be shown only on a single page   :|

- How can I do that?

Instead of wysiwyg, choose Code for the page type. Then write the call to show_menu2 directly into the page. I have created a demo of this at http://code.jellycan.com/sm2test/pages/site-map.php

Quote from: virgil on May 04, 2006, 02:09:33 PM
- Wich release of the snippet do I at least nee?

v3.0 to get keywords and descriptions. Ensure that you pass SM2_DESCKEY in the flags. For example the code I used in the sample page is...


show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL|SM2_DESCKEY,
   '<span class="stuff">[a][page_title][/a] (menu: [a][menu_title][/a])'.
   '<br /><i>[description]</i><br />([keywords])</span>',
   "<ul class='sitemap'>",'</ul>','<li>','</li>',false,false);


Cheers,
Brodie