Solved

IF Statement for calling a tpl file.

Posted on 2009-07-07
1
279 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-
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn how to count occurrences of each item in an array.
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)

830 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