Hello,
My website has 6 pages and i made 6 different templates that almost looks the same exapt for one image.
Is it possible to make one template and put in a code that says, if you visit site1.php use image1.jpg and if you visit site2.php use image2.jpg?
If this is possbile, how can i do this?
Thanks.
Bas
[Solved] Using one template with different images on different pages
-
purplerain12
- Forum Members

- Posts: 110
- Joined: Thu Aug 14, 2008 10:33 am
[Solved] Using one template with different images on different pages
Last edited by Anonymous on Fri Aug 15, 2008 7:39 am, edited 1 time in total.
Re: Using one template with different images on different pages
You could use logic as described here and modify with something like $pagealias instead... Or retrieve the rootpages alias and use that instead....
http://forum.cmsmadesimple.org/index.ph ... l#msg77986
Ronny
http://forum.cmsmadesimple.org/index.ph ... l#msg77986
Ronny
-
dont
Re: Using one template with different images on different pages
I use this in my template {random} where the picture must be.
And I created this "user defined tag"
$page = $_GET["page"];
if($page=="example") {
echo "example";
}
else {
$rand = rand(1, 7);
echo $rand;
}
And I created this "user defined tag"
$page = $_GET["page"];
if($page=="example") {
echo "example";
}
else {
$rand = rand(1, 7);
echo $rand;
}
-
Nick Smart
- Forum Members

- Posts: 116
- Joined: Mon Jul 28, 2008 4:48 pm
Re: Using one template with different images on different pages
If you've only got half a dozen pages and a 1:1 relationship between images and pages, then create a second content block in your template and then put the appropriate image link in the second content block on each page. You only need 1 template and no UDTs.
Nick
Nick
-
purplerain12
- Forum Members

- Posts: 110
- Joined: Thu Aug 14, 2008 10:33 am
Re: Using one template with different images on different pages
Thank you verry much.
I liked the solution of the user defined tags. I tried and it works fantastic.
Thanks.
I liked the solution of the user defined tags. I tried and it works fantastic.
Thanks.
-
christiaans
- Power Poster

- Posts: 300
- Joined: Tue Mar 04, 2008 10:37 am

