How to put {ANY_ALIAS_IMG} into header of template?
How to put {ANY_ALIAS_IMG} into header of template?
Hi all,
It is my first post and first question.
Is there a way to put dynamic image {placeholder/replacement} in the header part of template?
Let’s say if I go to url index.php?contact I will have image contact.jpg
displayed in header and if I go to index.php?any_alias I will see anyaliass.jpg in a header part of the page?
It is my first post and first question.
Is there a way to put dynamic image {placeholder/replacement} in the header part of template?
Let’s say if I go to url index.php?contact I will have image contact.jpg
displayed in header and if I go to index.php?any_alias I will see anyaliass.jpg in a header part of the page?
jo
ye, the first one sounds good -- but why would I need a CMS for?Pappnase wrote:hello
there are two ways! one you create for each its own template!
or you ask jan212 for his script! or you wait for the next release.*smile*

if anybody know the answer, please help.
What I need is just a {IMAGE:$alias}

jo
Hi Jo,m
here is a little code that will help you out for now. it is a bit sloppy as it is tied to the category_ID and NOT the alias: i will have a quick look later for the alias solution.
for this code you will new to....
create a dir in you img folder called 'cat_images' and place within all the images you require, these must be named the same as cat_image_(cat_id).gif (example: cat_images_1.gif)
then place this code where ever you would like, whether it be in the template or in an article.
some changes you may wish to make:
change this to any path you choose: "img/cat_images/"
change this to any prefix you choose: ."myFileNamePrefix".
change this to any .extension you choose: .gif
you may also change the code in various ways to create a link of the image, add ALT tags etc.
hope it helps.
ps: to have the image reflect the article_id instead of the cat_id you should do something like this...
very simmiler 
here is a little code that will help you out for now. it is a bit sloppy as it is tied to the category_ID and NOT the alias: i will have a quick look later for the alias solution.
for this code you will new to....
create a dir in you img folder called 'cat_images' and place within all the images you require, these must be named the same as cat_image_(cat_id).gif (example: cat_images_1.gif)
then place this code where ever you would like, whether it be in the template or in an article.
Code: Select all
[PHP]echo "<img src=\"img/cat_images/"."cat_image_".$GLOBALS['content']['cat_id'].".gif\">";[/PHP]
change this to any path you choose: "img/cat_images/"
change this to any prefix you choose: ."myFileNamePrefix".
change this to any .extension you choose: .gif
you may also change the code in various ways to create a link of the image, add ALT tags etc.
hope it helps.
ps: to have the image reflect the article_id instead of the cat_id you should do something like this...
Code: Select all
[PHP]echo "<img src=\"img/article_images/"."article_image_".$GLOBALS['content']['article_id'].".gif\">";[/PHP]

Last edited by pSouper on Wed 5. May 2004, 12:31, edited 1 time in total.
Code: Select all
<?php
switch($GLOBALS['content']['cat_id']) {
// BOF 1=Your cat with ID 1
case 1: echo '<img src="img/head/my_img_1.jpg" alt="alt">'; break;
// EOF
// BOF 2=Your cat with ID 2
case 2: echo '<img src="img/head/my_img_2.jpg" alt="alt">'; break;
// EOF
// to be continued...
default: echo '<img src="img/head/my_def_img.jpg" alt="alt">';
}
?>
case "cat_id_int":echo '<img src>'; break;
Save the code from the code block below uner a new file. place it in the inc_ext folder in a new folder and call it like
{PHP:include/inc_ext/myfolder/myexample.php}
Regards/ Grüsse/ Groetjes - JAN212
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
SORRY TO ALL - I WAS ILL LAST WEEK AND COULDN'T SUPPORT THE COMMUNITY - and was busy all the time too...
now i am back on the track - regards to oliver, pappnase, frold, psouper, jérôme, snobba and all others...
now i am back on the track - regards to oliver, pappnase, frold, psouper, jérôme, snobba and all others...
Regards/ Grüsse/ Groetjes - JAN212
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
hi p,
thx to you and nice sleep
- 24/7 support - we should work together...
|°~-| RAZZRRRRRRRRRRR....
thx to you and nice sleep

|°~-| RAZZRRRRRRRRRRR....
Regards/ Grüsse/ Groetjes - JAN212
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------