![]() |
Code to show a template on only the front page
I need to know how to have a custom template only show on the front page of the CMS. I have installed a custom slider on my vB 4.2.2 CMS using the widget system. The widget that I'm using has a custom template powering it. I need to know how to show that slider only on the front page of my CMS. Right now obviously it shows on all the CMS pages. :(
Link: http://lenmkaiser.com/vb/vb4/content.php |
You Can Try
Code:
<vb:if condition="$nodeid == 1"> </vb:if> Code:
<vb:if condition="(THIS_SCRIPT == 'vbcms' AND !$_GET['r'])"></vb:if> |
Quote:
|
Quote:
Code:
<vb:if condition="in_array($nodeid,array(1, 2, 3))"> |
I tried that and it did not show up. How do you find what the node id is? I thought it was the id of the link in the Navigation Manager but that did not work either. I tried it with nodeid of 1 and tried it with nodeid of 8 because the Navigation Menu had the id of the tab as 8.
|
Anyone know why this first code does not work on a particular page?
Code:
<vb:if condition="$nodeid == 1"> </vb:if> |
Try this for the CMS home page:
Code:
{vb:raw $vbulletin->parentnode} The page at the end of the post says the node id is the number after the 'r=' Code:
content.php?r=116-my-phpcontent.php/116-my-php |
Quote:
Code:
<vb:if condition="(THIS_SCRIPT == 'vbcms' AND !$_GET['r'])"><div class="cms_slider">{vb:raw static_html}</div></vb:if> |
Have you tried?
Code:
<vb:if condition="(THIS_SCRIPT == 'vbcms' AND !$_GET['r=114'])"><div class="cms_slider">{vb:raw static_html}</div></vb:if> |
Quote:
|
Ok I'm not great with code, so these ideas will need some polish :D
Have you tried using double ='s ... r==114? What about another AND clause that blocks it from parentnode? If an AND clause won't work, perhaps a vbelse? E.G. <vb :else>if r=parentnode don't display </ vb:else> I haven't actually looked at vBulletin code in awhile, I'm struggling with my "advanced" programming class and visual basic :o |
Tried the double = signs that did not work either. As for the other I do not know how to do that. I'm not a PHP programmer I code HTML & CSS and that is the extent of it. So I do not know a lot about the PHP codes. I know some but not enough to be able to create code from scratch.
|
I don't know if that code is the right way to do it or not, but I think you'd want this:
Code:
<vb:if condition="(THIS_SCRIPT == 'vbcms') AND ($_GET['r'] != 114)"><div class="cms_slider">{vb:raw static_html}</div></vb:if> |
Quote:
|
OK, try changing it to $_GET['r'] == 114 . But like I said, I don't know if that's the way to do it, I'm just trying to fix the posted code, because I don't think $_GET['r==114'] was right.
|
If that doesn't work then a shot in the dark here might :D
before the AND in the previous code from kh99 ... Code:
AND ($_GET['r'] != parentnode) Code:
<vb:if condition="(THIS_SCRIPT == 'vbcms') AND ($_GET['r'] != parentnode) AND ($_GET['r'] != 114)"><div class="cms_slider">{vb:raw static_html}</div></vb:if> |
Thanks but that only shows on the front page too. :( on both of those. :(
|
Code:
<vb:if condition="$_GET['r']==114"></vb:if> |
Quote:
|
Quote:
|
Glad it worked for you.
|
All times are GMT. The time now is 10:19 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|