The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Hello ,
i try to add a custom template on sidebar-block , but don't show anything PHP-BLOCK: PHP Code:
and i used {vb:raw ad_location.var} for show my template on anywhere on forum templats but not works on sidebar - Html Block. Thank you ! |
#2
|
|||
|
|||
![]()
if you want to see it right away make sure you set the cache time to 0
|
#3
|
||||
|
||||
![]()
You need to register the variables for use in the template. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide
|
Благодарность от: | ||
omardealo |
#4
|
||||
|
||||
![]() Quote:
PHP Code:
PHP Code:
Thank you ! |
#5
|
|||
|
|||
![]() PHP Code:
This was modeled after the page @Lynne referred you to, it is revised for forum blocks. |
#6
|
||||
|
||||
![]() Quote:
Thanks, but i did not understand very well this way I do created three templates ? Then what? How will the template show inside the block? I reviewed the solutions here https://vborg.vbsupport.ru/showthread.php?t=293516 But it did not work with me ![]() --------------- Added [DATE]1400632326[/DATE] at [TIME]1400632326[/TIME] --------------- when i put anything without variables , it Show inside block so , this code is work good , PHP Code:
|
#7
|
|||
|
|||
![]()
PM me your plugin code, forum_block code, and block templates. I will take a look at it.
You are talking about just adding an 'Ad' via a plugin to a custom "forum block", correct? The array ($ad_locator) is already registered to all templates that use the templater. Therefore, if you write a plugin to hook "parse_templates" the "$ad_locator" array variable will already be passed to the template (does not need to be registered). The same is true if you are passing a template to that same variable. To reiterate there are several global variables that are automatically registered to the template system, "ad_locator" is one of them. For Example: if I create the template variable {vb:raw ad_location.tbworld_ad_template_hook_variable} in my custom "forumblock" template, then the following plugin code will display my custom 'AD' template inside my custom "forumblock" template; Plugin: PHP Code:
Custom Forum Block Template: "block_tbworld" HTML Code:
<!-- block_tbworld - START --> <!-- Custom "forum_block" template --> <li> <div class="block smaller"> <div class="blocksubhead"> <a class="collapse"> <!-- collapse code chopped --> <span class="blocktitle">{vb:raw blockinfo.title}</span> </div> <div class="widget_content blockbody floatcontainer"> <div id="block_tbworld_{vb:raw blockinfo.blockid}" class="blockrow"> <!-- This is where the forum block "$output" is sent --> <!-- This can be another template or HTML code. --> {vb:raw content} <!-- Template Variable: for custom "AD" template or custom "AD" HTML code --> {vb:raw ad_location.tbworld_ad_template_hook_variable} </div> </div> </div> <div class="underblock"></div> </li> <!-- block_tbworld - END --> |
#8
|
||||
|
||||
![]()
Exactly , that's what i want .. yeah
i sent to you my code on PM , becouse i try this way but not work with me .. thnx bro , |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|