MyBB Community Forums

Full Version: Templates and Themes questions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So... I am pretty new to MyBB, and I was trying to put Google analytics code on my site. I have tried in the headerinclude and in the footer, and it simply didn's show up when the site was sent to a browser. Thinking it may be the theme I was using, I went back to default. Boom, the code showed up.

My question is this, is there a file where I can put code, like the GA stuff, in either the header or footer, and have it apply across all themes? I have a few installed and want users to be able to choose between them, but I don't want to have to remember to edit every theme!

If I do have to do it on a per theme basis, my solution is simple, only use one or two themes, but then, where do I find the place in the theme to put the code?

Any assistance is much appreciated, and if you give me a good answer I will owe you a virtual pizza and beer.

UPDATE: I found where to go and put it individually for each theme. Still looking for a -global- place to put things. Thanks.

FURTHER UPDATE: As I play and dig, I noticed Global templates instead of the default ones. There is nothing here. If I put a headerinclude here, will it get added to the current themes header?

Grrr... I shouldn't drink beer and web develop at the same time. I cannot use the name of an existing template in global, so I created a new one and put the code there. However it does not show up in the site. If someone can help with that, it will all be solved!
Use the headerinclude or the footer in the templates used by each theme. That is how it works.
(2012-12-19, 05:46 AM)Leefish Wrote: [ -> ]Use the headerinclude or the footer in the templates used by each theme. That is how it works.


Thanks, that's what I have done for now. I just wish there were a way to do it once.
Per the docs I have read, the global templates are supposed to be for every theme, but I do not know how to make a new global template work.

My poor brain thought that it should work something like this, global-header + theme-header= what is sent. But no such luck.

Thanks for your help.