The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
vBulletin 4 template hooks usage example
Can somebody provide an example of injecting advanced html code into some template hook? By "advanced html code" I mean html code enhanced with special vBulletin 4 structures, such as {vb:raw somevar}, {vb:rawphrase somevar} and <vb:if condition="...">code</vb:if>.
Or you can point me to some mod that implements such injections. Thanks. |
#2
|
||||
|
||||
You cannot do that.
The best you could do is have it in another template, render that template, and add the result to the template hook. |
#3
|
|||
|
|||
Would you happen to know where I can find some documentation on what you just said. That's exactly what I need to do. I have something that goes into a hook in forum home. I want to be able to put that hook on any other template or in a widget; can i do that?
|
#4
|
|||
|
|||
Quote:
PHP Code:
HTML Code:
<vb:if condition="!empty($vboptions['lancerforhire_paid_registration_jquery'])"> <script type="text/javascript" src="{vb:raw vboptions.lancerforhire_paid_registration_jquery}"></script> </vb:if> <script type="text/javascript"> <!-- $(document).ready(function() { if (THIS_SCRIPT == 'register') { $('.pre_registration_description').removeClass('hidden'); } else { $('.post_registration_description').removeClass('hidden'); } }); // --> </script> |
#5
|
|||
|
|||
Quote:
Code:
{vb:raw template_hook.forumhome_above_forums} Code:
if (in_array(THIS_SCRIPT, array('index'))) { $template_hook['forumhome_above_forums'] .= vB_Template::create('vbcms_widget_static_page')->render(); } hook location: Global Start Execution order: 5 But when I place that hook in the widget , the output is still: Code:
{vb:raw template_hook.forumhome_above_forums} P.S.: I can change the hook that is going to be used. Maybe I need to create a new hook to use in the widget? |
#6
|
|||
|
|||
Quote:
--------------- Added [DATE]1309016499[/DATE] at [TIME]1309016499[/TIME] --------------- Sorry, I meant forumhome_complete, not parse_templates. |
#7
|
|||
|
|||
OK made the change but still nothing. I think it has to do with the plug-in that controls the content that's going into that hook in forum home. Wouldn't I have to also render the template of the content that's going into the widget or vbcms_widget_static_page template?
Also cleared cache and cookies in case they were rendered in the cookies. Any ideas? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|