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??
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??
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
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
{include file='banner.tpl'}