The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to get a widget to only display on home page? (ad related)
I'm trying to get an ad/widget to only display on the home page of my site. The ad management system in VB won't let me do that and I can't figure out a way to get a widget to only display on the home page. I'm ok modifying a php file to custom include something in just the home page if that's necessary. Any thoughts?
|
#2
|
|||
|
|||
Are you talking about widgets on the CMS, or ads/forum blocks on the forum?
|
#3
|
|||
|
|||
Widgets on the CMS. Really anything on just the front/home page of the CMS. If it requires modification of a php file to manually insert content that's ok, I just don't know which one.
|
#4
|
|||
|
|||
bump
|
#5
|
||||
|
||||
Copy the template for the widget (shown in the Configure box) and then put a condition around the new widget template code to only show it on the first page. Make sure you edit the widget's template name (again, shown in the Configure box) to the new template name.
|
#6
|
|||
|
|||
What's the code for the condition? This is a "static HTML" type widget.
|
#7
|
|||
|
|||
Lynne answered this on another forum numerous times already...I wish i could find it right now but I can't. Just keep doing a search on Google or here and you will find it.
|
#8
|
|||
|
|||
bump ... couldn't find the answer to this. Lynne can you give an example on how to put a condition around this widget? I am not a coder so this is pretty confusing to me. TIA
|
#9
|
|||
|
|||
Well, I'm a little confused - CMS widgets only show up on the content.php page anyway --- which is "home" on most sites.
That out of the way, a PHP widget to do this could probably look something like this: PHP Code:
I hope I've not confused you in return |
#10
|
|||
|
|||
Ok I sort of found it in this thread: https://vborg.vbsupport.ru/showthrea...home+page+only
So based on what was said here, I made a new template called: vbcms_widget_static_page_home Here's the code for it: Code:
<vb:if condition="$_GET[r] == ""> <div class="cms_widget"> <div class="block"> <div class="cms_widget_header"> <h3><img src="{vb:stylevar imgdir_siteicons}/html.png" alt="" /> {vb:raw widget_title}</h3> </div> <div class="cms_widget_content widget_content"> {vb:raw static_html} </div> </div> </div> </vb:if> Quote:
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|