Solved

common code for serveral files in tpl- html??

Posted on 2007-12-05
7
674 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
Comment Utility
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
Comment Utility
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
Comment Utility
try to add that line in a PHP file of the skin and not inside a TPL file
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:axtur
Comment Utility
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
Comment Utility
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
Comment Utility
or maybe your TPL files need to be broken down into smaller files?
0
 

Author Comment

by:axtur
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
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 …

762 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

11 Experts available now in Live!

Get 1:1 Help Now