PDA

View Full Version : Use the pagename in template conditionals


Briskoda
08-24-2004, 05:17 PM
Okay trying to achive navigation on the sidebar using conditionals.

That is if I'm in FORUMHOME I'll display forum links and tools, eg 24hour posts.

If I vist the newsportal page I'll display some news navigation.

If I vist the membersarea I'll display the links for this area and so on.

Thus if I use:
<if condition="THIS_SCRIPT == 'adv_index' ">

I can tell when I am on a portal page. Using:

<if condition="THIS_SCRIPT == 'FORUMHOME' ">

I know I'm on a vb forum page. Similar for hacks eg arcade etc.

Now what I'm trying to access is the pagekey, eg cmps_index.php?page=mycustomnav

So that in my conditionals I can lookup the page parameter and display based on that.

I am presently using a global side bar owing to photopost, reviewpost and various other hacks. I am tempted to drop the global sidebar nav in favour of other ideas I have read about. But at this point would like a little nudge in the right direction re the above.

Cheers.
Colin.

Briskoda
08-24-2004, 05:33 PM
arh I need new eyes...I totally missed this thread...it appears to function how I desire now...http://www.vbadvanced.com/forum/showthread.php?t=1202&highlight=identifier

Next step personalisation, but first I sleep.

Our Sponsors
 

hpwilhelm
08-24-2004, 05:52 PM
Hi Colin!

This looks like just what I'm looking for also! Hope you will share! :)

Thanks,
HP

Briskoda
08-24-2004, 05:58 PM
The 2nd reply and link works....

As mentioned I'm using the global sidebar mod.

<if condition="$pages['name'] == 'latestnews' OR $pages['name'] == 'skodanews' OR $pages['name'] == 'generalnews' OR $pages['name'] == 'motorsportnews' OR $pages['name'] == 'industrynews'">
<tr><td class="alt2">&nbsp;-<a href="$bburl/home/?page=skodanews">Skoda News</a></td></tr>
<tr><td class="alt1">&nbsp;-<a href="$bburl/home/?page=generalnews">General News</a></td></tr>
<tr><td class="alt2">&nbsp;-<a href="$bburl/home/?page=MotorSportnews">MotorSport News</a></td></tr>
<tr><td class="alt1">&nbsp;-<a href="$bburl/home/?page=Industrynews">Industry News</a></td></tr>

</if>


That code is in my sidebar template. If you visit www.briskoda.net/home/?page=latestnews

You will see the latest news expanded.

Just working on reviewpost and gallery atm. Apologies for the chaotic apperance I'm having a bad month.

If it's re the personalisation...will do when I've worked what is worthwhile. I presently have three user fields (6 actually) called custom links. This allows the user to add 3 links and descriptions. These then appear in the sidebar when populated, not many folk know about them, but those who do use them alot.

Our Sponsors
 

Briskoda
08-24-2004, 06:08 PM
Reviewpost and photopost working via the addition of define('THIS_SCRIPT', 'reviews');

Changing reviews for gallery etc to the header-inc.php file. Again this assumes you are integrating Reviewpost/Photopost to vb Styles. Site now also working with ReviewPost etc.

It looks a tad untidy as I'm building all this on this style so the users begin to get used to it. Less of a rug pull when I goto a slighlty different layout, that is main topology of navigation over the top of the site with specifics to that navigational zone on the left...