PDA

View Full Version : THIS SCRIPT for Article Page?


Sadikb
12-16-2010, 11:25 AM
Hi

In VBCMS is there any counterpart of the SHOWTHREAD and FORUMDISPLAY this_script only for the article page?

What I want to do is to display some html only on the article page, but the code has to be put in the footer. In forums, i would simply do this in the footer template where my code is

<vb:if condition="THIS_SCRIPT == 'showthread'">
blah blah blah
</vb:if>

I want to do similar but for article page. Any hints guys?

Thanks

calorie
12-16-2010, 01:41 PM
There is this defined for the CMS:

define('THIS_SCRIPT', 'vbcms');

Does that work for you?

Sadikb
12-16-2010, 01:53 PM
Hi Calories, thanks for your reply.

No it won't work because i want to be able to use the THIS_SCRIPT only for the article page, not for section page, not for category and not for CMS Home page.

calorie
12-16-2010, 03:23 PM
Untested but maybe a plugin at the cache_templates hook:

// if we are in the CMS and the article page temple is there
// then define a constant for use in a template conditional

if (THIS_SCRIPT == 'vbcms' && in_array('vbcms_content_article_page', $cache))
{
define('ON_ARTICLE_PAGE_ONLY', true);
}

And then the following template conditional in the footer:

<vb:if condition="defined('ON_ARTICLE_PAGE_ONLY')">
blah blah blah
</vb:if>

Sadikb
12-16-2010, 09:46 PM
Nopes it doesn't work, though the idea seems fine.

It's very late here... will try again in the morning.

tpearl5
02-18-2012, 02:15 PM
I'm curious if you ever got this working?

Sadikb
02-18-2012, 02:28 PM
Actually I don't remember... :)

I think I did get it to work at that time but since then I have changed almost everything on my site and so I don't know what I had done.