The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
[RESOLVED] Where are the header and headinclude templates rendered?
I'm considering a project that will require modifications to the head and headinclude templates but I don't want to give instructions for editing them, instead I want to create header_alt and headinclude_alt templates and have them rendered instead of the usual ones. This way the product can be turned off and the code will just go back to using the usual templates. I'm hoping there's a hook available where I can change the template rendered for the product.
Or is there a better way of going about this? |
#2
|
||||
|
||||
create a new style and edit those templates
|
#3
|
|||
|
|||
I need these changes for all styles. And I won't be able to "force" users to switch from one style to another (or maybe I can but it's just not an acceptable way). My project (if it ever comes to fruition) is a secure login and that requires changes to the login form and several new JS files.
|
#4
|
||||
|
||||
This will likely require file edits. Use Andreas' Template Modification System (TMS) instead.
|
#5
|
|||
|
|||
I found it in includes/class_bootstrap.php, public function process_templates(). There's a hook on line 561, "process_templates_complete", where I can do something like this:
Code:
if($argle == 'bargle') { $templater = vB_Template::create('header_alt'); $templater->register('ad_location', $ad_location); $templater->register('pmbox', $pmbox); $templater->register('notifications_menubits', $notifications_menubits); $templater->register('notifications_total', $notifications_total); $templater->register('notices', $notices); $templater->register('facebook_header', $facebook_header); $header = $templater->render(); } |
#6
|
||||
|
||||
What about the hook, template_render_output
Code:
if ($this->template == 'header') { $this->template = 'header_alt'; } if ($this->template == 'headinclude') { $this->template = 'headinclude_alt'; } |
#7
|
|||
|
|||
Looks like that will work. I'm just planning this now so it will be a while before I test it. Thanks.
|
#8
|
||||
|
||||
No problem, I have used that hook in a few mods, and it seem to function just fine.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|