![]() |
looking for tutorial that explains how to show variable to different templates
Hi,
I was wondering if there is something that explains how to show variables in not registered templates? for example, Variable X is registered in xyz template. How to modify it to show variable X in abc template. how to show total threads in HEADER template? thanks |
Quote:
Edit: Your plugin code could be something like (and parse_templates is probably a good hook to use): PHP Code:
and then put {vb:raw totalthreads} in header template where you want it. This adds a query to every page, and it's always good to reduce the number of queries to speed up your site, but it's probably not a big deal. You could cache the value in the datastore, but that's a more advanced topic. |
is there a benefit of unsetting the $tt variable at the end? First time I've seen it used in this context…
|
Quote:
|
Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide
|
All times are GMT. The time now is 06:57 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|