SmartMenus DHTML Menu / JavaScript Menu - Forums

forums

You are not logged in.

#1 2007-Mar-22 10:50:13

cash
Member
Registered: 2005-Feb-10
Posts: 5

Current links

First of all,
I have recently update the Smartmenus on my site from v5 to v6, and all I can say is,  great job!smile  I really like it (v5 was allready great, v6 is super).

I have one question about the c_findCURRENT option. I have it set to active and it works as advertised.
But, and I'll take an example from my site here. This is my guestbook, here the 'Guestbook' and 'view guestbook' links are current http://www.virtualtigers.com/guestbook.php .
But if I go for example to the 2nd page with guestbook entries http://www.virtualtigers.com/guestbook.php?entry=15  it does no loner show as current in the menu.  Because the '?entry=15' is added to the url.  Is there any way to at least get the 'Guestbook' link  as current, even when viewing other pages on the guestbook?

Thanks for your help!

Offline

 

#2 2007-Mar-22 17:03:24

smartmenus
Site Admin
From: Plovdiv, BULGARIA
Registered: 2003-Feb-23
Posts: 1109
Website

Re: Current links

First of all, thanks for your kind words - I am happy you like SM6! smile

Well, the script cannot do what you would like automatically because you know that many sites use dynamic URLs. And, for example, if the script would make CURRENT the following link:

http://www.virtualtigers.com/guestbook.php

even when the user is on the following location:

http://www.virtualtigers.com/guestbook.php?entry=15

this might be OK for your specific page but it would not be OK for many other sites that use dynamic URLs.

So instead, you can possibly do this "manually" - I suppose you keep your menu structure in a separate file and use a PHP include to include it on all your pages. If this is the case, then you can change the following in the include file:

Code:

<li><a class="NOLINK" href="">Guestbook</a>
...

with something like this:

Code:

<li><a class="NOLINK<?php

if(strpos($_SERVER['REQUEST_URI'], "guestbook.php") !== false)
    echo " CURRENT";

?>" href="">Guestbook</a>
...

This would add the CURRENT class to your Guestbook link whenever the "guestbook.php" file is visited no matter what the query string is.

I hope this helps! Please let me know if you have any questions.

Cheers!


-Vasil Dinkov-

Offline

 

#3 2007-Mar-23 08:38:51

cash
Member
Registered: 2005-Feb-10
Posts: 5

Re: Current links

I am indeed using php includes.

Thanks, this is exactly what I was looking for cool

Last edited by cash (2007-Mar-23 08:40:54)

Offline

 

Board footer

Powered by FluxBB