Solved

common code for serveral files in tpl- html??

Posted on 2007-12-05
7
675 Views
Last Modified: 2008-02-01
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
Comment
Question by:axtur
  • 4
  • 3
7 Comments
 
LVL 7

Expert Comment

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

{include file='banner.tpl'}
0
 

Author Comment

by:axtur
ID: 20424542
It doesn't work, it would display {include file='banner.tpl'} instead of the code contained in banner.tpl...
0
 
LVL 7

Expert Comment

by:Wod
ID: 20424623
try to add that line in a PHP file of the skin and not inside a TPL file
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:axtur
ID: 20424630
That would be easy :), but what i need is the tpl file to read from another tpl / html file
0
 
LVL 7

Expert Comment

by:Wod
ID: 20424721
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
 
LVL 7

Accepted Solution

by:
Wod earned 500 total points
ID: 20424725
or maybe your TPL files need to be broken down into smaller files?
0
 

Author Comment

by:axtur
ID: 20424798
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Find out what you should include to make the best professional email signature for your organization.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now