MyBB Community Forums

Full Version: create a template and then insert the template to an other template?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well i would like to create a new template and then insert it to an other template by using a code like <navigation> or $navigation i dont mind at all.

i hope you understand what i mean.
1. Download Template Conditionals http://mybbhacks.zingaburga.com/showthread.php?tid=464 (tplcond-1.7.7z)
2. Activate it
3. Create a template (Templates -> Add Template -> choose your set -> name it for example my_new_template)
4. In another template(s), in which you want to inject it, add <template my_new_template>
I activated but nothing.

I think its because it moves it on ungroupped templates and i dont know how to move to forum display for example...
Sorry, but what? I don't see how it is relevant to the question asked in topic, which I answered.

Once again - to put the new template inside another one you need to use <template YOURTEMPLATENAME> inside the other template, where YOURTEMPLATENAME is the name of new custom template you created. It will put the code from YOURTEMPLATENAME to the place where you inserted it.
So if the my_new_template contains this:
<tr><td class="trow2"><strong>Hello world</strong></td></tr>
And you'll put <template my_new_template> in index_birthdays:
<tr><td class="tcat"><span class="smalltext"><strong>{$lang->todays_birthdays}</strong></span></td></tr>
<tr>
<td class="trow1"><span class="smalltext">{$bdays}</span></td>
</tr>
<template my_new_template>
It will output:
<tr><td class="tcat"><span class="smalltext"><strong>{$lang->todays_birthdays}</strong></span></td></tr>
<tr>
<td class="trow1"><span class="smalltext">{$bdays}</span></td>
</tr>
<tr><td class="trow2"><strong>Hello world</strong></td></tr>

If you want the template to be under another templates in ACP, not in ungrouped, you need to write own plugin and insert it to the set you want with query (requires PHP and MySQL knowledge, look how is it done for example in MyAlerts), but I don't see the connection to the question asked in topic.
(2013-05-30, 07:42 PM)Destroy666 Wrote: [ -> ]Sorry, but what? I don't see how it is relevant to the question asked in topic, which I answered.

Once again - to put the new template inside another one you need to use <template YOURTEMPLATENAME> inside the other template, where YOURTEMPLATENAME is the name of new custom template you created. It will put the code from YOURTEMPLATENAME to the place where you inserted it.
So if the my_new_template contains this:
<tr><td class="trow2"><strong>Hello world</strong></td></tr>
And you'll put <template my_new_template> in index_birthdays:
<tr><td class="tcat"><span class="smalltext"><strong>{$lang->todays_birthdays}</strong></span></td></tr>
<tr>
<td class="trow1"><span class="smalltext">{$bdays}</span></td>
</tr>
<template my_new_template>
It will output:
<tr><td class="tcat"><span class="smalltext"><strong>{$lang->todays_birthdays}</strong></span></td></tr>
<tr>
<td class="trow1"><span class="smalltext">{$bdays}</span></td>
</tr>
<tr><td class="trow2"><strong>Hello world</strong></td></tr>

If you want the template to be under another templates in ACP, not in ungrouped, you need to write own plugin and insert it to the set you want with query (requires PHP and MySQL knowledge, look how is it done for example in MyAlerts), but I don't see the connection to the question asked in topic.
you know exactly what i want to do but for some reason it does not work i will make a video so u can see.

http://www.screenr.com/uYHH
hey guys i would like to let everyone know that it works.

You just have to keep the name template the same and add with the new one you made.

<template myname>

myname is the template of the new you created for an example.

thanks destroyBig Grin