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 11-17-2010, 08:25 AM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default widget only on one page.

i have created a static html widget,
and i want it to be shown only on the main page.

i mean, when someone navigates to an article for e.g , this widget will dissappear.

to see what i mean, you can go to www.emath.co.il and click the menu on the right side.. the articles are changed, but the top widget stays.

any ideas?

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

Your example is of a widget that stays on all article pages, but it sounded like you wanted a widget that disappears on all article pages. Can you clarify this?

If you want a widget to disappear on some pages that are in the same section, you will have to create a custom template for it that has a condition around it to only show on page x (node == x). Insert that custom template name in the Configure screen for the widget.
Reply With Quote
  #3  
Old 11-17-2010, 02:38 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can u give me the full condition for that ?
Reply With Quote
  #4  
Old 11-17-2010, 05:58 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'd have to look in the template to see what the variable name is. I can't just guess. It would be something like:
<vb:if condition="$variable[node] == x">stuff</vb:if>

You may be able to use r.
<vb:if condition="$_GET[r] == x">stuff</vb:if>
Reply With Quote
  #5  
Old 11-17-2010, 06:06 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry , i dont understand...

this is the only code ive in the template :

Quote:
{vb:raw static_html}
and it called : vbcms_widget_static_page_no_border

i want that this widget will appear only on the first page . if navigating to other category or artice, the widget will be gone.

from where i need to get the variable name ? u said "to look in the template to see what the variable name is"

ive paste the template code :S

and what is X ?

thank alot lynne.
Reply With Quote
  #6  
Old 11-17-2010, 09:03 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The template gets evaled somewhere and variables get used in it. If all that is in it is that one line, then I honestly don't know what variable you can use. Usually there is code right before a template is rendered in the code and all the variables get defined that you may use in that template. You'd have to find where it is evaled to see what the name of the variable is.

As for x, x is the nodeid.
Reply With Quote
  #7  
Old 11-17-2010, 09:24 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i think you misunderstood me.

i need a if condition that will do this :

if main cms page
render the widget[widget code]
else
dont render the widget
if end

is that what u guide me to ?

if so, where can i search where the template gets evaled..?
Reply With Quote
  #8  
Old 11-17-2010, 10:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And that is what you would be doing if you put and if condition around it based on the nodeid.

I don't know where you are evaling that template. It's not a default template. Since you said it's an html widget, I'd guess in the widget/static.php file. I'm thinking you are going to have to just go with $_GET[r] (r is in the browser url of the page)
Reply With Quote
  #9  
Old 11-18-2010, 06:49 AM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ive tried like these ways (none of them worked) :
Quote:
<vb:if condition="$_GET['http://www.emath.co.il/'] == 'index-1'">
{vb:raw static_html}
</vb:if>
Quote:
<vb:if condition="$_GET[r] == 'index-1' ">
{vb:raw static_html}
</vb:if>
Reply With Quote
  #10  
Old 11-20-2010, 01:01 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any help please?

where do i get the nodeid ?
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 02:05 AM.


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.04307 seconds
  • Memory Usage 2,251KB
  • Queries Executed 11 (?)
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
  • (3)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
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete