MyBB Community Forums

Full Version: Help Please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do I set a global template to be able to be in other templates e.g.

Global template -> test
ttttt

Default Template -> header
$test (so it's showing ttttt)

Regards
- Melon Fresh
You have to add the following code to the .php file you want "ttttt" to show up on:
eval("\$test = \"".$templates->get("test")."\";");
Here is the code I have
<?php
$templatelist = "new_page";
require "./global.php";
eval("\$new_page = \"".$templates->get("new_page")."\";");
outputpage($new_page);
?>

But I want the contents of new_page to show in the header of my forum
Open global.php
Find:
eval("\$header = \"".$templates->get("header")."\";");
Add above it:
eval("\$new_page = \"".$templates->get("new_page")."\";");

Make sure that you have $new_page in your header template.
How would someone go about making a new page, that pulls all of its data from a template? Thanks!
I would assume you go to global templates create a new template, put your template code, save, and then use eval("\$new_page = \"".$templates->get("new_page")."\";"); to fetch the new page, where new_page is your template name