vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   widget only on one page. (https://vborg.vbsupport.ru/showthread.php?t=253819)

emath 11-17-2010 08:25 AM

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

Lynne 11-17-2010 01:32 PM

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.

emath 11-17-2010 02:38 PM

can u give me the full condition for that ?

Lynne 11-17-2010 05:58 PM

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>

emath 11-17-2010 06:06 PM

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.

Lynne 11-17-2010 09:03 PM

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.

emath 11-17-2010 09:24 PM

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..?

Lynne 11-17-2010 10:05 PM

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)

emath 11-18-2010 06:49 AM

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>

emath 11-20-2010 01:01 PM

any help please?

where do i get the nodeid ?


All times are GMT. The time now is 12:53 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.01963 seconds
  • Memory Usage 1,728KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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