PDA

View Full Version : Conditional NavBar Items


interfx
11-11-2006, 08:49 PM
How do I make items on the navbar (usercp, New posts, ...) conditional based upon the page?

ie. on the VBa home page, do not want the UserCP, New Posts in the NavBar. However, on the Forums page want them to show up???

Any suggestions? treid if statements, but not working how I'm trying...

Ideas?

Brian
11-12-2006, 03:32 PM
<if condition="$pages['name'] == 'home'"> Link </if>

Our Sponsors
 

interfx
11-13-2006, 04:11 PM
So here's what I did. Very close, but must be missing something basic... This makes the forums page (the default nav buttons bar) have no navbar, but not on the home page...

Ideas?



<if condition="$pages['name'] == 'home'"> Home Reviews, ...


</else>

<!-- nav buttons bar -->

<!-- nav buttons bar -->

</if>

texasf1racer
11-14-2006, 12:48 AM
I'm wanting to do something like that too. I would like the link 'Forums' to be on the top left of the NavBar when on the Home page and when in the forums I would like that same link to change to Home. Using the code you attached Brian, the 'Forums' link does show up only when on the home page, but when I used the same code for the 'Home" link off the forums page(changing 'home' to 'forums' in your code), the 'Forums" link doesn't change to a 'Home' link, it actually disappears all together...any idea what I have wrong with the code below? Thx! ;)


<if condition="$pages['name'] == 'forums'"><td class="vbmenu_control"><a href="http://www.f1racerforums.com">Home</a></td></if>

Our Sponsors
 

texasf1racer
11-15-2006, 11:51 PM
I'm wanting to do something like that too. I would like the link 'Forums' to be on the top left of the NavBar when on the Home page and when in the forums I would like that same link to change to Home. Using the code you attached Brian, the 'Forums' link does show up only when on the home page, but when I used the same code for the 'Home" link off the forums page(changing 'home' to 'forums' in your code), the 'Forums" link doesn't change to a 'Home' link, it actually disappears all together...any idea what I have wrong with the code below? Thx! ;)


...Anyone have an idea how to do this?

Brian
11-16-2006, 12:43 PM
http://www.vbadvanced.com/forum/showthread.php?t=9689&highlight=forum+home+link

texasf1racer
11-16-2006, 05:19 PM
Ah sweet thx! I totally didn't see that thread. Thanks for the link! :)