Link to home
Start Free TrialLog in
Avatar of axtur
axtur

asked on

common code for serveral files in tpl- html??

I have some .TPL files (basically they are inside HTML), actually they are a PHPBB skin, and i want to include some portions of code to be read from an common place for several different .tpl files

lets say i want to include 10 lines of code, located in "banner.html", in 10 different .TPL files, I'm not going to write this 10 times over again everytime I change it, hOw can i set this code in a commonplace for all the files??

Open in new window

Avatar of Wod
Wod
Flag of United States of America image

you could convert your banner.html to banner.tpl and then use this inside your main tpl (ie: sidebar):

{include file='banner.tpl'}
Avatar of axtur
axtur

ASKER

It doesn't work, it would display {include file='banner.tpl'} instead of the code contained in banner.tpl...
try to add that line in a PHP file of the skin and not inside a TPL file
Avatar of axtur

ASKER

That would be easy :), but what i need is the tpl file to read from another tpl / html file
would it work if you add it at the very beginning or end of the TPL ?

if that would work for you, you could add it in the PHP right before or right after that TPL gets loaded and it would be like it's part of the other TPL

ASKER CERTIFIED SOLUTION
Avatar of Wod
Wod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of axtur

ASKER

I think I'm gonna break my tpl file into smaller ones, since I can't find the way to "include" other tpl files into another one. And change the PHP code, I don't like this solution, is not very "elegant", but works just fine.