Solved

IF Statement for calling a tpl file.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Specific format 21 181
Problem to ToolkitScriptManager 2 51
Recursive folder search vbscript 7 40
Can I exclude specific directory with icacle command? 3 25
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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)

912 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

15 Experts available now in Live!

Get 1:1 Help Now