No announcement yet.

How do I use variables in the header template?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I use variables in the header template?


    I am currently still building my forums, and I have a funny feature, that I want to show up in my header template.

    So in index.php, let's say that I have a variable called $example, and I want this to show up in the header template.

    Problem is that it don't show up. I have also tried using this variable in my FORUMHOME template, and it works great there.. still in the wrong place though..

    I tried creating another template that contains my variable, and then calling it from index.php and linking it again in header.php, but it didn't work either.

    Is the header template a special template?

  • #2
    The header template isn't special, it's just evaluated/generated in global.php, not index.php. So if you want a variable to be evaluated in the header template, you have to put it in global.php. If you have any more questions about modifying files, however, you should go to where discussions regarding code changes can be done.
    Bugdar: PHP bug tracking software that is beautiful, fast, and robust.


    • #3
      That just helped me a LOT! Thanks!


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.