WebsiteBaker Support (2.8.x) > Templates, Menus & Design

show_menu2: valid XHTML and CSS selectable menus

<< < (16/64) > >>

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.


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

--- End code ---

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.


--- Code: ---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>";

--- End code ---

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



--- Quote ---Note that in my stuff the call to show_menu2 is all on one line.
--- End quote ---
... 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:
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

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


--- Code: ---show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL|SM2_DESCKEY|SM2_MULTIMENU, ...
--- End code ---

@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:
@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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version