Solved

IF Statement for calling a tpl file.

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

708 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