bobbo
07-15-2004, 03:19 PM
OK, I've read all the threads I can find on condtionals with VBA CMPS. I've managed to solve a few of my conditional coding needs, however one keeps coming back to bite me and I can't figure out what I am missing....
I am sure there are a few methods to do what I am trying to do, however if we can assume we want to do it the way that I describe here, perhaps someone might be able to help me find a solution that will also assist me in other coding areas.
Let's say that on my home page under my navbar menus I want to have some content that only shows up on my cmps_index home page. In my specific example, this content happens to be a cool embedded flash file.
Now, lets say that I want the code for this content to reside in my navbar template. The main reason I choose this location is because I wanted my flash document to spread across the 3 columns below that contain my VBA blocks...
Again, I assume there are multiple ways to make this work, but assuming this method, I would need to wrap conditionals around my flash code so that it only appears on my home page and none of the other VBA CMPS pages that I have created, nor the rest of the site for that matter....
I know that <if condition="THIS_SCRIPT == 'adv_index'"> will allow me to choose any page that renders from the cmps_index.php file. However, I only want the home page.
I've tried various conditional variations and have found (Thanks Brian) that if I use:
<if condition="$pages['name'] == 'pagenamehere'">Flash Content</if>
It works within the realm of a module/block however, the same conditional will not work from within the navbar template.
Do I simply need to somehow reference the $pages variable somewhere else in a different VB3 file to make it more global? Also, I'm not sure if this has any relevance, but I run my cmps_index.php from outside the /forums directory.
As always, I appreciate your ideas.
Bobbo
I am sure there are a few methods to do what I am trying to do, however if we can assume we want to do it the way that I describe here, perhaps someone might be able to help me find a solution that will also assist me in other coding areas.
Let's say that on my home page under my navbar menus I want to have some content that only shows up on my cmps_index home page. In my specific example, this content happens to be a cool embedded flash file.
Now, lets say that I want the code for this content to reside in my navbar template. The main reason I choose this location is because I wanted my flash document to spread across the 3 columns below that contain my VBA blocks...
Again, I assume there are multiple ways to make this work, but assuming this method, I would need to wrap conditionals around my flash code so that it only appears on my home page and none of the other VBA CMPS pages that I have created, nor the rest of the site for that matter....
I know that <if condition="THIS_SCRIPT == 'adv_index'"> will allow me to choose any page that renders from the cmps_index.php file. However, I only want the home page.
I've tried various conditional variations and have found (Thanks Brian) that if I use:
<if condition="$pages['name'] == 'pagenamehere'">Flash Content</if>
It works within the realm of a module/block however, the same conditional will not work from within the navbar template.
Do I simply need to somehow reference the $pages variable somewhere else in a different VB3 file to make it more global? Also, I'm not sure if this has any relevance, but I run my cmps_index.php from outside the /forums directory.
As always, I appreciate your ideas.
Bobbo