Solved

IF Statement for calling a tpl file.

Posted on 2009-07-07
1
281 Views
Last Modified: 2012-05-07
Hi, I have a problem that i need the homepage of a xcart site to use a different head.tpl than the rest of the site, but the head.tpl is pulled into one global file.

I have recreated the 2nd file and called it head2.tpl and basically i want to say

(by the way this is not supposed to represent real code as i have no clue for this)

if homepage/index then {include file="head.tpl" }

else use: {include file="head2.tpl" }

If anyone can advise that would be great, need this asap.

Many thanks in advance
0
Comment
Question by:BaldNut-
[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
1 Comment
 
LVL 3

Accepted Solution

by:
Siridivi earned 500 total points
ID: 24799894
What scripting language are you using? If I were doing this in PHP it would be:

if($_SERVER['REQUEST_URI'] = "index.php"){
   include('head.tpl');
} else {
             include('head2.tpl');
}

Check out the PHP Super Globals, they come in handy for these kinds of situations.

http://us.php.net/manual/en/language.variables.superglobals.php
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

There is a huge demand for CodeIgniter among the PHP web developers due to its dynamic features and benefits these days. It is one of most popular and agile open source PHP framework for creating robust web applications in PHP web development field.…
Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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 …

630 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