vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   About widgets in article pages (https://vborg.vbsupport.ru/showthread.php?t=254682)

Sdahe 12-04-2010 10:33 PM

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?

Lynne 12-04-2010 11:04 PM

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.

Sdahe 12-05-2010 04:32 PM

Quote:

Originally Posted by Lynne (Post 2129404)
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

Lynne 12-05-2010 08:17 PM

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>


Sdahe 12-05-2010 10:33 PM

Quote:

Originally Posted by Lynne (Post 2129759)
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?

Lynne 12-05-2010 10:41 PM

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.

Sdahe 12-05-2010 10:42 PM

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


All times are GMT. The time now is 02:58 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.02355 seconds
  • Memory Usage 1,724KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete