{NAV_MENUBAR} Dropdown menubar

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

Hi ondergang
Hi all, i get the toplevel to work, but the subitem doesn’t show as a submenu but rather then a link text on my page.
Any idea what should i do now?
thanks!!!
Can u show a link please? I don't understand your question, my intellect is somehow limited as well as my php, css, html and design skills, but I (and almost everyone here) try to anwser to the questions I DO KNOW the answer, not just for posting...

Also, should you try to ask in a little bit more nicer way (instead of being sarcastic or plain rude ?) I'm sure you would get more replies, otherwise ... you'll just be ignored by most and that is sad, because everyone here is very keen in helping others.

Cheers
ondergang
Posts: 9
Joined: Sat 2. Oct 2004, 21:15

Post by ondergang »

Hi Kosse :)
Thank you soo much!!! I didn’t expect any help certainly after my last post.

I followed the instructions and i put this in my header:
<script type="text/javascript" src="/phpwcms_template/inc_js/menubar.js"></script>
<link href="/phpwcms_template/inc_css/menubar.css" rel="stylesheet" type="text/css" />

If you click on downloads you will see it doesn’t show the submenu but rather then a text link on my page self
http://www.eddart.com/pw/

Here you can see my articles structure:
http://www.eddart.com/pw/naamloos.bmp

Thanks again for you’re help i appreciate it very much
JensZ
Posts: 136
Joined: Wed 16. Feb 2005, 12:18
Location: Stockholm, Sweden
Contact:

Post by JensZ »

Dear Ondergang,

I am not sure what you expect to see, but it doesn't look like you have any sublevels. Hence, you will not see submenues. The menubar seems to be working just fine.

Best Regards,

Jens
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

ondergang wrote:Hi Kosse :)
Thank you soo much!!! I didn’t expect any help certainly after my last post.
...
Here you can see my articles structure:
http://www.eddart.com/pw/naamloos.bmp

Thanks again for you’re help i appreciate it very much
As JensZ pointed out (--> you see pple will help you) ;) , you'll have to have sublevels (don't forget to set to -1 in admin if u want only the first article to be displayed) to show a submenu, as for articles, you'll need to link to them (content part article link) or use other techniques (in forum there is teaser_tag and others that can help you).

Btw, if you are just starting to build your site I'll suggest you use 1.2.6 version (instead of RC1.4, that is like 1 year old and lacks features), it's stable and offers (much) more possibilities.

Cheers
ondergang
Posts: 9
Joined: Sat 2. Oct 2004, 21:15

Post by ondergang »

Thanks JensZ & Kosse!!!

Kosse : good advice :D I am gonna install 1.2.6 and try to link it properly this time
Stim
Posts: 587
Joined: Mon 6. Jun 2005, 13:13

Post by Stim »

Is it possible to choose category to display in menu?
JensZ
Posts: 136
Joined: Wed 16. Feb 2005, 12:18
Location: Stockholm, Sweden
Contact:

Post by JensZ »

You can always hide the structure levels that you don't want to see.
ramchester
Posts: 19
Joined: Fri 11. Jun 2004, 11:10

Post by ramchester »

Is the a way to make this work on a multilingual site? For example I have:

- English
--- Info
--- Links
--- Contact
- French
--- Fries
--- Nuggets
--- Rolls
- German
--- Cars
--- Women
--- Magazines

I could have something like {NAV_MENUBAR:1} depending on the id of the structure level I want to show on the page. This way I could show only English on one page and French on the other.

So how about it? :D
[Ramchester]
JensZ
Posts: 136
Joined: Wed 16. Feb 2005, 12:18
Location: Stockholm, Sweden
Contact:

Post by JensZ »

I think it could be done quite easily with a few changes. I'm just guessing here, but try the following.

change #1:

Code: Select all

function getHorizMenuBar($startLevel = 0)
change #2:

Code: Select all

// Root level
if($struct == $startLevel)
change #3:

Code: Select all

if( ! ( strpos($content["all"],'{NAV_MENUBAR')===false ) ) 
{
	$content["all"] = preg_replace('/\{NAV_MENUBAR:(.+?)\}/ei','getHorizMenuBar($1);', $content["all"]);
	$content["all"] = str_replace("{NAV_MENUBAR}", getHorizMenuBar(), $content["all"]);
	$content["all"] = str_replace('{SITE}', PHPWCMS_URL, $content["all"]);	
}
The reptag will look like {NAV_MENUBAR[:structure_level_id]}, where the structure_level_id is optional.

Please let me know if it works...

Good luck!

JZ
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

Thank you so much Jenz for that awesome script :)
In case it might help others to get it running...

I was fighting a bit to get it working and
noticed that I simply had to modify the HEAD calls, a tiny bit. :wink:

Before: (as in the menubar.txt file):
<script type="text/javascript" src="/phpwcms_template/inc_js/menubar.js"></script>
<link href="/phpwcms_template/inc_css/menubar.css" rel="stylesheet" type="text/css" />

After: I simply had to modify the paths (by removing the first slash(s)):
<script type="text/javascript" src="phpwcms_template/inc_js/menubar.js"></script>
<link href="phpwcms_template/inc_css/menubar.css" rel="stylesheet" type="text/css" />

All's working perfect now :D

Thanks again JensZ 8)
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
mstroz
Posts: 53
Joined: Wed 13. Apr 2005, 18:38
Location: Macon, Georgia USA
Contact:

Post by mstroz »

Hi All,

Has anyone had any success turning this horizontal nav into a vertical nav? I've tried a couple of times with no luck. I love the script, and really need it vertical.

Thanks much.
Mark
Skipy
Posts: 87
Joined: Mon 26. Dec 2005, 22:10
Location: Germany
Contact:

Post by Skipy »

Hi!

Wow! I love your menubar! Its fantastic ....

I saw that you have placed a search function, a print function and a sitemap at the right site of your menu in http://www.ikfrej.se/...
Hej man! Tha looks cool! Is this version available for us too? That whuold be great :-)

Greetings
Skipy
jscholtysik

Post by jscholtysik »

Hi Skipy,


the search, print and sitemap functions are all standard functions in phpwcms... ;-)

Please search in the content parts and you will see...


Joachim
Skipy
Posts: 87
Joined: Mon 26. Dec 2005, 22:10
Location: Germany
Contact:

Post by Skipy »

Well, I saw this allready, thanx!

But he has integrated this in his menubar ... look at it! Its is awesome :-)

Greetings
Skipy
jscholtysik

Post by jscholtysik »

Hi Skipy,

you can integrate it wherever you want!

Example:

Sitemap

- Create a new site level named "sitemap" and alias "sitemap"
- Create in this site level a new article with content part "sitemap".
- Include in your template wherever you want the following code (for example near the breadcrumb menu):

Code: Select all

<a href="index.php?sitemap">Sitemap</a>
Now you can see a link called "Sitemap near your breadcrump menu that links to the content part sitemap... Simple, isn't it?


Joachim
Post Reply