MyBB Community Forums

Full Version: The addition of custom templates
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all, I'm back again!

This time, I'm not tryna fix anything, just trying to learn. What I wish to do, is to create a template, with certain code in it, then display it in another template.

For example (this isn't what I'm using it for), you create an About Us page or something, you create the PHP document referencing a template, which has the majority of the code, simple enough. Say for example you have a list on said page, but you wish to use the template for ease of edibility later on, how would I do that? 

So far, I have created this template, bit when I reference it in the master template, it kicks up the security risk

Anyone able to help me out?

Cheers, 
Adams

Edit:

After playing around with it for a while, I tried adding the following template to the PHP file of my custom page:

eval("\$1_1 = \"".$templates->get("1_1")."\";");

This is however causing the webpage to stop working entirely? If someone can help me out, that'd be greatly appreciated
not enough info.. please provide more specifics.
So, lets say Im making a page that features a list on it.

To start off, I created my php page, calling a template I created for this page. What I want to do, is create another template that contains the list items and call this template in the main page template