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

Reply
 
Thread Tools Display Modes
  #1  
Old 12-04-2010, 10:33 PM
Sdahe Sdahe is offline
 
Join Date: May 2009
Location: San Juan, PR
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default About widgets in article pages

Hello,

I'm looking for a mod that would let me have a widget in the front-page (content.php) but not in the articles page. Let say I would like to have a banner or a video in the front-page only...and when a person clicks on an article that banner is not there.. just in the front-page.

Can this be done?
Reply With Quote
  #2  
Old 12-04-2010, 11:04 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You may create a widget and use a custom template with the widget (enter name into Configure screen) and then put a condition around the template to only show it on the main page.
Reply With Quote
  #3  
Old 12-05-2010, 04:32 PM
Sdahe Sdahe is offline
 
Join Date: May 2009
Location: San Juan, PR
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
You may create a widget and use a custom template with the widget (enter name into Configure screen) and then put a condition around the template to only show it on the main page.
Sorry but I'm not much of a programmer... can you tell me how to do it.. thanks
Reply With Quote
  #4  
Old 12-05-2010, 08:17 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I'm not going to do it for you (and I can't since you didn't provide enough info), but copy the template that the widget uses (as I said, it is listed in the Configure screen) and put it in a new template and then put a condition around it - something like this:
HTML Code:
<vb:if condition="$_GET['r'] == '1-your-page-name' OR !$_GET['r']">
template code
</vb:if>
Reply With Quote
  #5  
Old 12-05-2010, 10:33 PM
Sdahe Sdahe is offline
 
Join Date: May 2009
Location: San Juan, PR
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Well, I'm not going to do it for you (and I can't since you didn't provide enough info), but copy the template that the widget uses (as I said, it is listed in the Configure screen) and put it in a new template and then put a condition around it - something like this:
HTML Code:
<vb:if condition="$_GET['r'] == '1-your-page-name' OR !$_GET['r']">
template code
</vb:if>
Thank you very much...

The only thing I have to change is where it says 1-your-page-name right?... that would be content.php right?
Reply With Quote
  #6  
Old 12-05-2010, 10:41 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, it would be the name of the home page. Many leave out that part of the condition because usually you get there via just clicking Home and then there is no r=whatever at the end of the url. But, if you go there via a link, it will have that attached at the end.
Reply With Quote
  #7  
Old 12-05-2010, 10:42 PM
Sdahe Sdahe is offline
 
Join Date: May 2009
Location: San Juan, PR
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Get it

So the code would be like this... right?

Code:
<vb:if condition="$_GET['r'] == '' OR !$_GET['r']">
template code
</vb:if>
--------------- Added [DATE]1291596570[/DATE] at [TIME]1291596570[/TIME] ---------------

Perfect... it's working great

Thank you very much
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 05:54 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.05886 seconds
  • Memory Usage 2,224KB
  • 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
  • (1)bbcode_code
  • (2)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete