View Full Version : navbar question
FRANKTHETANK 2
02-14-2009, 11:13 PM
How do you make a link change from forum and home depending on what page your on. For example, when your on the home page it would show forum. And when your on forum it would show Home Page
Lynne
02-14-2009, 11:27 PM
<if condition="THIS_SCRIPT == 'index'">show home link</if>
<if condition="THIS_SCRIPT == 'whatever-you-call-home'">show index link</if>
FRANKTHETANK 2
02-14-2009, 11:47 PM
The following error occurred when attempting to evaluate this template:
The conditional on line 89 appears to be missing its beginning tag (<if>). This may cause unexpected behavior.
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
I get that error
Lynne
02-15-2009, 12:08 AM
whoops.... condition, not conditions. Fixed above.
FRANKTHETANK 2
02-15-2009, 12:13 AM
Still not working, here is the code i'm putting in.
<td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td>
<if condition="THIS_SCRIPT == 'index.php'">Home</if>
<if condition="THIS_SCRIPT == 'home.php'">Forum</if>
Is this right or wrong. It shows up forum no matter what I do
Lynne
02-15-2009, 12:25 AM
No, that isn't correct because of two issues. First, THIS_SCRIPT is defined at the top of your php page. For instance, this is the line at the top of index.php:
define('THIS_SCRIPT', 'index');Thus, this is the correct condition:
<if condition="THIS_SCRIPT == 'index'">Home</if>Find the name of the home script at the top of the home.php page.
Second, you want the link to look the same as this line:
<td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td>That is the code (with "whatever-you-call-home" replaced with the correct name from the top of home.php) you would use in place of "Forum":
<if condition="THIS_SCRIPT == 'whatever-you-call-home'"><td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td></if>
FRANKTHETANK 2
02-15-2009, 12:36 AM
ok the script at the top of my home page is
define('THIS_SCRIPT', 'provb_blhome');
So
My code would be this right or wrong?
<if condition="define('THIS_SCRIPT', 'provb_blhome');"><td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td></if>
When I put it in i get an error
vBulletin Message
The following template conditional expression contains function calls:
<if condition="define('THIS_SCRIPT', 'provb_blhome');">
Function Name Usage in Expression
define define('THIS_SCRIPT', 'provb_blhome')
With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.
The following functions are allowed in template conditional expressions:
in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg() is_browser() is_member_of()
Dismounted
02-15-2009, 03:23 AM
<if condition="THIS_SCRIPT == 'provb_blhome'"><td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td></if>
FRANKTHETANK 2
02-15-2009, 12:57 PM
none of these are working. My home page is called home.php and my forum is index.php.
This is were i put the code
<if condition="THIS_SCRIPT == 'provb_blhome'"><td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td></if>
<td class="vbmenu_control">
<a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
</if>
<if condition="$show['registerbutton']">
<td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td>
</if>
SEOvB
02-15-2009, 01:02 PM
<td class="vbmenu_control"><if condition="THIS_SCRIPT == provb_blhome"><a href="index.php$session[sessionurl_q]">Forum</a><else /><a href="/home.php" rel="nofollow">Home</a></if></td>
<a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
</if>
<if condition="$show['registerbutton']">
<td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td>
</if>
Try that one
FRANKTHETANK 2
02-15-2009, 01:08 PM
That worked thank you everyone sorry i couldn't get it to work
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.