The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hi all,
I am trying to add a forum block that I want to display only in one of my subforums. I am using it to create a menu that relates only to that single sub forum. Any advice on how I could achieve this? Thank you all for your usual helpfulness. |
|
#2
|
|||
|
|||
|
anyone got any infor on doing this please?
|
|
#3
|
|||
|
|||
|
have you done a search for a plugin for it
|
|
#4
|
|||
|
|||
|
Are you creating a "Custom HTML/PHP" forum block? You can try this: Go to the style manager and copy the code of the "block_html" template, then create a new template and paste the code and surround it with an if, like this:
Code:
<vb:if condition="$GLOBALS['forumid'] == X"> // code from block_html goes here </vb:if> Then at the bottom of forum block configuration page there's a "Template to Use" field. You can put the name of your new template there. |
|
#5
|
|||
|
|||
|
basic starting point, so yes of course I have...
Quote:
Thanks again
|
|
#6
|
|||
|
|||
|
ok so I tried this, but when I save the new template i get this error...
Code:
The following error occurred when attempting to evaluate this template: Parse error: syntax error, unexpected ')' in /home/digitale/public_html/includes/adminfunctions_template.php(5432) : eval()'d code on line 1 This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish. Here is the template that im trying to save... Code:
<vb:if contents="$GLOBALS['forumid'] == 156'>
<li>
<div class="block smaller">
<div class="blocksubhead">
<a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a>
<span class="blocktitle">{vb:raw blockinfo.title}</span>
</div>
<div class="widget_content blockbody floatcontainer">
<div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow">
{vb:raw content}
</div>
</div>
</div>
<div class="underblock"></div>
</li>
</vb:if>
|
|
#7
|
|||
|
|||
|
That's my fault, there's a mistake in the code I posted. The first line should be:
Code:
<vb:if condition="$GLOBALS['forumid'] == 156"> Sorry. |
|
#8
|
|||
|
|||
|
appreciate the help buddy,
I'll go try it out and let you know how it goes ![]() --------------- Added [DATE]1350831890[/DATE] at [TIME]1350831890[/TIME] --------------- same issue Code:
<vb:if contents="$GLOBALS['forumid'] == 156">
<li>
<div class="block smaller">
<div class="blocksubhead">
<a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a>
<span class="blocktitle">{vb:raw blockinfo.title}</span>
</div>
<div class="widget_content blockbody floatcontainer">
<div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow">
{vb:raw content}
</div>
</div>
</div>
<div class="underblock"></div>
</li>
</vb:if>
|
|
#9
|
|||
|
|||
|
Oh, yeah - it's "condition", not "contents":
Code:
<vb:if condition="$GLOBALS['forumid'] == 156"> I have no idea what I was thinking that day. |
|
#10
|
|||
|
|||
|
well it has accepted it now, but nothing shows up in my forumid 156
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|