0

I need help to make an included template to appear only on two pages and not on other pages of a photo album. Can someone help me out on how to use the "elseif" statement to accomplish this?
Right now template file appears on every page, which is not what I want. This is what I've got so far:

<?php
//Display slide
include('myfirst.tpl');
?>

A hint of what I want to achieve is below:

<php
if "list-album"
include('myfirst.tpl')
elseif "list-image"
include('myfirst.tpl')
elseif "list-image"
do nothing
?>

The script uses $_GET method. The pages are "list-album", "list-image" and "image-detail". I want the template to be show on "list-album" and "list-image", but not on "image-detail". Any help will be appreciated.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by mexabet
0

Something like this?:

$page = "mypage"; // You enter the page here
if ($page == "list-album") {
include('myfirst.tpl');
} 
elseif ($page == "list-image") 
{
include('myfirst.tpl');
} 
else 
{
include("somethingelse.html.inc");
}
0

Thanks Graphix,

I have managed to fix it, but will keep your code in case of next time.

Something like this?:

$page = "mypage"; // You enter the page here
if ($page == "list-album") {
include('myfirst.tpl');
} 
elseif ($page == "list-image") 
{
include('myfirst.tpl');
} 
else 
{
include("somethingelse.html.inc");
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.