Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-08-2015, 10:46 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 01-08-2015, 11:43 PM
bridge2heyday's Avatar
bridge2heyday bridge2heyday is offline
 
Join Date: Aug 2014
Location: Egypt
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You Can Try
Code:
 <vb:if condition="$nodeid == 1"> </vb:if>
OR
Code:
<vb:if condition="(THIS_SCRIPT == 'vbcms'  AND !$_GET['r'])"></vb:if>
Reply With Quote
Благодарность от:
MarkFL
  #3  
Old 01-09-2015, 12:01 AM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bridge2heyday View Post
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.
Reply With Quote
Благодарность от:
MarkFL
  #4  
Old 01-09-2015, 12:06 AM
bridge2heyday's Avatar
bridge2heyday bridge2heyday is offline
 
Join Date: Aug 2014
Location: Egypt
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HM666 View Post
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))">
Reply With Quote
  #5  
Old 01-09-2015, 01:59 AM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 02-02-2015, 11:59 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 02-03-2015, 07:45 AM
John Lester John Lester is offline
 
Join Date: Nov 2004
Posts: 543
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 02-05-2015, 11:28 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by John Lester View Post
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?
Reply With Quote
  #9  
Old 02-06-2015, 06:25 PM
John Lester John Lester is offline
 
Join Date: Nov 2004
Posts: 543
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #10  
Old 02-07-2015, 06:11 AM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by John Lester View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04466 seconds
  • Memory Usage 2,274KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (13)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete