PDA

View Full Version : Dynmic Link In Nav Bar


Mavrik347
10-29-2008, 07:45 PM
Hi guys is there anyway to make a link in my navbar so when people are on the Home page (vBAdvanced) it says "Forum" and links to it but when you are on the forum the link says "Home" and links you there?

I was thinking something like (Pseudocode):

if url = http://www.britishroguewarriors.com/index.php then
<a href="/forum/">Forum</a>
else
<a href="../index.php">Home</a>
end if

Lynne
10-29-2008, 09:09 PM
Yes, you can use THIS_SCRIPT for that:
<if condition="THIS_SCRIPT == 'whatever'">
<a href="/forum/">Forum</a>
<else />
<a href="../index.php">Home</a>
</if>

Find what THIS_SCRIPT is defined as at the top of your Home page.

SEOvB
10-29-2008, 11:51 PM
i think the name of vBAdvanced is advindex so taking lynnes code


<if condition="THIS_SCRIPT == 'advindex'">
<a href="/forum/">Forum</a>
<else />
<a href="../index.php">Home</a>
</if>


is what you'd be looking for

Mavrik347
10-31-2008, 02:12 AM
Not working :/ It's up at the moment. It doesn't seem to be 'advindex' so do you know where (file, page or line) I would find it?

Lynne
10-31-2008, 02:20 AM
You need to find the line that looks like this at the top of the page. This is where THIS_SCRIPT is defined:

define('THIS_SCRIPT', 'whatever');

Mavrik347
10-31-2008, 12:56 PM
Brilliant, thanks. vBA is "adv_index".