WebsiteBaker Support (2.8.x) > Templates, Menus & Design
show_menu2: valid XHTML and CSS selectable menus
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:
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
--- Quote ---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.
--- End quote ---
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
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.
ruebenwurzel:
@virgil
--- Quote ---I know... but I am fund of the additional possibilities of the sitemap with
description and keywords, what the original sitemap doesn't offer...
--- End quote ---
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.
--- End quote ---
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
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.
--- End quote ---
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
--- End quote ---
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
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version