Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

IF Statement for calling a tpl file.

Posted on 2009-07-07
1
Medium Priority
?
282 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 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to dynamically set the form action using jQuery.
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…

705 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