Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 705
  • Last Modified:

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

0
axtur
Asked:
axtur
  • 4
  • 3
1 Solution
 
WodCommented:
you could convert your banner.html to banner.tpl and then use this inside your main tpl (ie: sidebar):

{include file='banner.tpl'}
0
 
axturAuthor Commented:
It doesn't work, it would display {include file='banner.tpl'} instead of the code contained in banner.tpl...
0
 
WodCommented:
try to add that line in a PHP file of the skin and not inside a TPL file
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
axturAuthor Commented:
That would be easy :), but what i need is the tpl file to read from another tpl / html file
0
 
WodCommented:
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

0
 
WodCommented:
or maybe your TPL files need to be broken down into smaller files?
0
 
axturAuthor Commented:
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.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now