The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Rendering Custom Template
I have tried following this: https://vborg.vbsupport.ru/showthread.php?t=228078 but no luck with what I am trying to do.
Most probably it will be simple solution but I can not get it to work. (I am new to writing plugins etc ...) What I am trying to do is: I have template name "TEST" with just simple HTML code <div>Some text</div> And I just want this HTML to be inserted into e.g. footer template. I have tried this in global_start plugin. PHP Code:
PHP Code:
PHP Code:
But that template does not show in footer template. Thanks . |
#2
|
||||
|
||||
If you are creating a whole different footer template, then I would call it something else. The footer template gets rendering by the vbulletin engine very early on, and if you are using the same name, then you may get weird results.
|
#3
|
||||
|
||||
No, I just want to add something to footer template ... but need separate template for it, as this template will be edited frequently. I am working on a simple product which I will release here if successful
. |
#4
|
||||
|
||||
Ah, now I see what you are doing. I wasn't reading it correctly. The first code that you posted looks correct. However, what hook location are you using? As I said before, the footer template gets rendered at the very beginning (in the global.php file) and you may to render it again in order to get your stuff added.
|
#5
|
||||
|
||||
Ah, now I see what you are doing. I wasn't reading it correctly. The first code that you posted looks correct. However, what hook location are you using? As I said before, the footer template gets rendered at the very beginning (in the global.php file) and you may to render it again in order to get your stuff added.
|
#6
|
||||
|
||||
I have used global_start hook location.
This seems to add the data to footer with the above hook. PHP Code:
. --------------- Added [DATE]1259711598[/DATE] at [TIME]1259711598[/TIME] --------------- I have searched "class_bootstrap.php" and found that "parse_templates" was called just before header and footer templates got rendered. "parse_templates" hook seems to work. . |
#7
|
||||
|
||||
So let's see the code you are trying to use to render the template and then preregister it. And, look up where the footer template is rendered... the parse_templates hook is right above there. Have you tried it?
|
#8
|
||||
|
||||
Yup, its working (As replied above)
Here is the code I used in "parse_templates" hook: PHP Code:
PHP Code:
Thanks . |
#9
|
||||
|
||||
How would one go about doing this in a way that would make a custom template available in all other templates, and not have to preRegister each of them?
Here's what I have so far. cache_templates PHP Code:
PHP Code:
parse_templates PHP Code:
Help? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|