MyBB Community Forums

Full Version: Custom pages without plugins and custom templates.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!

So I want to create custom pages on my site through the template system. I don't want to use a plugin like page manager because I want to know how to create custom pages myself so I can incorperate them into themes.

I also want to know how to include custom templates in other templates. Is there an object I need to call?

Thanks for your consideration.
http://community.mybb.com/thread-6615.html

To add custom pages in another page, you just have to use a Variable that is used to evaluate template.
(2010-11-22, 04:24 PM)Yaldaram Wrote: [ -> ]To add custom pages in another page, you just have to use a Variable that is used to evaluate template.

What variable? If you could simplify this a bit for me that would be great. Smile

For example, go to: http://community.mybb.com/thread-6615.html

There you find this;

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

This is the syntax used to "Evaluate" Templates. Now see the $rules variable, you can use this variable to show that page contents in your other pages, BUT have to globalize it first. For instance, if you are going to use this in your plugins, then you have to use this as;

global $mybb, $templates, $rules;
(2010-11-22, 07:54 PM)Yaldaram Wrote: [ -> ]For example, go to: http://community.mybb.com/thread-6615.html

There you find this;

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

This is the syntax used to "Evaluate" Templates. Now see the $rules variable, you can use this variable to show that page contents in your other pages, BUT have to globalize it first. For instance, if you are going to use this in your plugins, then you have to use this as;

global $mybb, $templates, $rules;

Thanks! Smile If my theming does well, you might get a present.