Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 25 Feb 2010, 21:40
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Real name: Anton Kanevsky
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.
__________________
I can no longer support any of my hacks. Please do not contact me for that. Feel free to create and post new versions of my hacks, as long as you give me credit for the original work.
Reply With Quote
  #2  
Old 25 Feb 2010, 22:10
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
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.
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #3  
Old 24 Jun 2011, 18:12
EquinoxWorld EquinoxWorld is offline
 
Join Date: Nov 2009
Originally Posted by Paul M View Post
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.
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?
Reply With Quote
  #4  
Old 25 Jun 2011, 14:41
vbresults vbresults is offline
 
Join Date: Apr 2009
Originally Posted by EquinoxWorld View Post
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?
A plugin from my paid registration mod (hook is parse_templates):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The template lancerforhire_paid_registration_head_include_script for reference:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #5  
Old 25 Jun 2011, 15:14
EquinoxWorld EquinoxWorld is offline
 
Join Date: Nov 2009
Originally Posted by Lancerforhire View Post
A plugin from my paid registration mod (hook is parse_templates):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The template lancerforhire_paid_registration_head_include_script for reference:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Thank you so much for the reply. I'm almost there. Here's what I got ; I want to use this hook:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

In a CMS html widget. I then created this plug in :


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

With product: vBulletin
hook location: Global Start
Execution order: 5

But when I place that hook in the widget , the output is still:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

What am I missing?? Any information will be incredibly useful. Thanks.

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?
Reply With Quote
  #6  
Old 25 Jun 2011, 15:38
vbresults vbresults is offline
 
Join Date: Apr 2009
Originally Posted by EquinoxWorld View Post
Thank you so much for the reply. I'm almost there. Here's what I got ; I want to use this hook:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

In a CMS html widget. I then created this plug in :


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

With product: vBulletin
hook location: Global Start
Execution order: 5

But when I place that hook in the widget , the output is still:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

What am I missing?? Any information will be incredibly useful. Thanks.

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?
Try using the forumhome_complete hook, not global_start (which is deprecated in 4.x anyway).

--------------- Added 25 Jun 2011 at 15:41 ---------------

Sorry, I meant forumhome_complete, not parse_templates.

Last edited by vbresults; 25 Jun 2011 at 15:41. Reason: Changed parse_templates to forumhome_complete
Reply With Quote
  #7  
Old 25 Jun 2011, 16:15
EquinoxWorld EquinoxWorld is offline
 
Join Date: Nov 2009
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?
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 21:37.

Layout Options | Width: Wide Color: