vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Code to show a template on only the front page (https://vborg.vbsupport.ru/showthread.php?t=316517)

HM666 01-08-2015 10:46 PM

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

bridge2heyday 01-08-2015 11:43 PM

You Can Try
Code:

<vb:if condition="$nodeid == 1"> </vb:if>
OR
Code:

<vb:if condition="(THIS_SCRIPT == 'vbcms'  AND !$_GET['r'])"></vb:if>

HM666 01-09-2015 12:01 AM

Quote:

Originally Posted by bridge2heyday (Post 2531382)
You Can Try
Code:

<vb:if condition="$nodeid == 1"> </vb:if>
OR
Code:

<vb:if condition="(THIS_SCRIPT == 'vbcms'  AND !$_GET['r'])"></vb:if>

Thanks! EDIT: The second code worked.

bridge2heyday 01-09-2015 12:06 AM

Quote:

Originally Posted by HM666 (Post 2531386)
Thanks! So on the first one if I changed the nodeid to whatever nodeid a particular page is i can have the widget show on just that page?

Yes , it should appear in this node only .. if you want to show in multiple nodes you can use
Code:

<vb:if condition="in_array($nodeid,array(1, 2, 3))">

HM666 01-09-2015 01:59 AM

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.

HM666 02-02-2015 11:59 PM

Anyone know why this first code does not work on a particular page?

Code:

<vb:if condition="$nodeid == 1"> </vb:if>
I have tried several different ID numbers to replace the 1 but nothing works and it is not showing on the page. Where do I find the nodeid of a page? Is it the number that shows in the friendly URL? Or is it the tab number? I've tried both in that space and neither work in that code above.

John Lester 02-03-2015 07:45 AM

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
http://www.estetica-design-forum.com...Bulliten-4-CMS

HM666 02-05-2015 11:28 PM

Quote:

Originally Posted by John Lester (Post 2535856)
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
http://www.estetica-design-forum.com...Bulliten-4-CMS

Ok I do not want it to show on the home page though. I want it to show on the nodeid page 114 only and no where else, what code do I use for that? I've tried all the code above and variations of those and nothing has worked. I've made a slider widget and I want it to only show on one page. The code for the template of the widget is:

Code:

<vb:if condition="(THIS_SCRIPT == 'vbcms'  AND !$_GET['r'])"><div class="cms_slider">{vb:raw static_html}</div></vb:if>
That code will show it only on the front page, but I want to move it to show only on the nodeid page of 114. How do I do that?

John Lester 02-06-2015 06:25 PM

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>

HM666 02-07-2015 06:11 AM

Quote:

Originally Posted by John Lester (Post 2536473)
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>

Yes and that shows it on the correct page but it also shows it on the home page (front page) as well though. I'd rather take it off the front page.


All times are GMT. The time now is 06:53 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
  • Page Generation 0.01130 seconds
  • Memory Usage 1,753KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (13)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete