sidebar conditional

king8084

Active member
i'm attempting to conditionalize an advertisement on my sidebar to only display when on the homepage of my forum. The problem I'm running into is that the template (aph_widget_content) that I'm attempting to add the ad code to doesn't appear to have any vars accessible from it. I'm sure I could utilize one of several options to get the conditional to work (ex: $contentTemplate, $requestPaths.fullUri, etc.), if they were available.

Is there a trick to getting [any of] these vars to work in the template i'm working with? and/or a way to find out which (if any) vars are accessible? I've primarily just been attempting to do a helper dump on the hard hitters that i'm aware of ($page, $forum, $thread, etc..).
 

grisha2217

Active member
Every page has a name called as 'contentTemplate'
You can show adv only on index page with this code:
Code:
<xen:if is="{$contentTemplate} == 'forum_list'">
// adv code
</xen:if>
 

king8084

Active member
Every page has a name called as 'contentTemplate'
You can show adv only on index page with this code:
Code:
<xen:if is="{$contentTemplate} == 'forum_list'">
// adv code
</xen:if>
that unfortunately doesn't work either. putting it in place evaluates to false even on the homepage. likewise, simply placing {$contentTemplate} returns no value (on any page).

again, this isn't a standard template, so i'm wondering if that's part of it (hence me being curious how to "pass" or "enable" those vars in the template?)
 

grisha2217

Active member
that unfortunately doesn't work either. putting it in place evaluates to false even on the homepage. likewise, simply placing {$contentTemplate} returns no value (on any page).

again, this isn't a standard template, so i'm wondering if that's part of it (hence me being curious how to "pass" or "enable" those vars in the template?)
I used this code in sidebar_visitor_panel and it is working.
It is condition for display content on index page
 

grisha2217

Active member
Forget about $contentTemplate
There is ad_sidebar_top in default style, yes?
This template included in PAGE_CONTAINER

Put your ads in ad_sidebar_top and use my condition
 
Top