MyBB Community Forums

Full Version: How to share variables across templates?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to share variables across templates?

for example, if I wanted to use the variables from
http://wiki.mybboard.net/index.php/Help:...ng_Postbit

but in a different template, like header or footer or other

How can I do this?

I tried passing one but it didn't work
It really wouldn't make sense to have postbit variables in the header.

As to answer your question, it really depends on which templates.
why wouldn't it make sense to be able to access all variables in any template?

guess some hard coding is required of the main php files, but that is a non issue.
(2009-05-26, 12:17 AM)warrenb Wrote: [ -> ]why wouldn't it make sense to be able to access all variables in any template?
On this page, there are 4 posts. Which post should the header template take the data from? Last one? First one?
(2009-05-26, 01:43 AM)Yumi Wrote: [ -> ]
(2009-05-26, 12:17 AM)warrenb Wrote: [ -> ]why wouldn't it make sense to be able to access all variables in any template?
On this page, there are 4 posts. Which post should the header template take the data from? Last one? First one?

On top of that populating all the variables would be a waste of system resources.
no longer an issue, we created a custom function to load the necessary variables