PDA

View Full Version : Including one template in another


m0nde
07-22-2008, 08:53 PM
I've created a template with html in it called

adv_portal_spring_raffle_2008_winners_bit

and in another template, I've included $adv_portal_spring_raffle_2008_winners_bit
but it does not show the information in that template

how do i get this to work?

I've previously done this with other templates to show various other information and it seemed to work.
This time it simply wont.

RLShare
07-22-2008, 08:56 PM
You would have to create a plug-in that fetches the first template data and stores it in a variable and then place a reference to that variable in the second template

But if the template is just a template, why not just copy the code over in place of the variable

m0nde
07-22-2008, 09:06 PM
You would have to create a plug-in that fetches the first template data and stores it in a variable and then place a reference to that variable in the second template

But if the template is just a template, why not just copy the code over in place of the variableThe information is added to each week and I want one place where I can add the winners so I don't have to enter it several times when I want to use that information.

It is used in 4 other templates.

I'll look up how to create that template data to store in a variable. Thankyou.

--------------- Added 1216764708 at 1216764708 ---------------

I've found that I need to include something like this:

$includedhtml = implode('', file('path/to/this/file/myfile.html'));

What do I do to create an array from a template?

Opserty
07-23-2008, 08:08 AM
<a href="http://www.vbulletin.com/docs/html/main/templates_externalfiles" target="_blank">Including External Files</a>

Why do you need to create an from a template? (Though that doesn't make much sense, what you said).

For the instructions given in the link for including a HTML file. Then just edit the HTML file and your changes should be reflected on the page.