Solved

common code for serveral files in tpl- html??

Posted on 2007-12-05
7
685 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

734 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