vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   CMS Home If conditional (https://vborg.vbsupport.ru/showthread.php?t=240063)

datarecall 04-08-2010 07:39 PM

CMS Home If conditional
 
I am trying to figure out what the conditional is to tell if we are on the HOME PAGE of the cms
Currently I am using : <vb:if condition="THIS_SCRIPT == vbcms"> however this fires anywhere content.php is there a way to find out if the homepage is loaded.

Lynne 04-08-2010 07:52 PM

You didn't say what template you are trying to put that in, so it's impossible to answer that question 100%. You want to use the $nodeid, but depending on where you use it, it's called something different and you may have to write a plugin to put it into a variable for you to use.

So, play with the $nodieid... look to see where your template is being rendered (search the files, please) - look at the code around it and you will see what your variable should be called. You may have to go 'backwards' in the code to figure out the variable name.

datarecall 04-08-2010 09:01 PM

the template I am trying to do it in is "header" basically just a featured article plugin i made but I only want it to show on the homepage.

cellarius 04-08-2010 09:40 PM

See this: http://www.vbulletin.com/forum/proje...?issueid=37252

datarecall 04-08-2010 09:51 PM

Thanks cellarius for the point in the right direction.

For anyone searching around this is what u have to do :
open /packages/vbcms/controller/content.php
After line 93 add
Code:

vB::$vbulletin->nodeid = $this->node->getNodeId();
Then goto your template page and put :
Code:

<vb:if condition="$vbulletin->nodeid == 1">........</vb:if>

datarecall 04-13-2010 06:31 PM

I upgrade the software to 4.0.3 but that fix does not work anymore.

peleh 07-21-2010 11:06 AM

Reaply the fix, it works.

The problem is now inside the articles, since the nodeid there gets diferent all the time, like, my section is nodeid 3, but inside an article of this section the nodeid is 120.

Macindy 08-22-2010 10:59 AM

Hi there!

I also have the problem, I can't do a if contional on the linked section if I am in the articles, because the articles have there own ids.

Any suggestion on this?

tpearl5 09-08-2011 07:56 PM

did anyone ever figure this out? I want to say if section and articles in that section, do something.

Dead Eddie 09-13-2011 02:08 AM

Add a hook to vbcms_article_populate_end:

PHP Code:

$view->parentid $this->content->getParentid(); 

Then the parent node id will be visible to the template.

Repeat for each content type needed.

(warning: untested!)


All times are GMT. The time now is 11:32 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.01043 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_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