Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 03 Jul 2012, 11:04
drjink drjink is offline
 
Join Date: Jun 2012
Loading templates within plugins

Greetings,

so i have been testing around for a while but i can't seem to get it to work.
I want to load a template into a variable within a plugin. I know how to access plugin-variables within templates but i can't find anything about how to load the template contents within a plugin. Is that even possible?
Reply With Quote
  #2  
Old 03 Jul 2012, 11:13
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
There and article here on rendering templates: http://www.vbulletin.org/forum/showthread.php?t=228078 , I think that explains what you need.
Reply With Quote
  #3  
Old 03 Jul 2012, 11:34
drjink drjink is offline
 
Join Date: Jun 2012
Yes, i found that one too but it doesn't seem to work.
Here is the thing, lets say i got a template named "my_template" and i want to load it within the plugin. According to that article i would write into my plugincode:

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

And assume that i now have the contents of that template in $rendered, but it doesn't seem to work that way.
What i get with that plugin activated is some missing things in my header, but no PHP error! I didn't even use the plugin any further, only those 2 lines of code activated screw someting up in the board.
Reply With Quote
  #4  
Old 03 Jul 2012, 11:38
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Which hook are you using?
Reply With Quote
  #5  
Old 03 Jul 2012, 13:42
drjink drjink is offline
 
Join Date: Jun 2012
global_bootstrap_init_complete

I just changed to global_bootstrap_complete and it may just work...i think it does...

Edit: Nope...i mean ok it does obviously work now somehow, the template gets stored into the variable, BUT with that hook, i can not use it in the header anymore. With the other hook that worked fine.
I don't know which hook i should use, so that both works. Just some hook that is always there that i can use for that.

Last edited by drjink; 03 Jul 2012 at 14:24.
Reply With Quote
  #6  
Old 03 Jul 2012, 14:43
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Try parse_templates - it's called just before the header template is rendered.
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
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 06:05.

Layout Options | Width: Wide Color: