Page 1 of 1

Changing an Image on every Page

Posted: Fri Dec 29, 2006 1:31 pm
by slinux
Hey and hello!
It's my first post in this forum, at first i wan't to say thanx to all the girls and boys
who programmed this real creat an very simple cms.
THANX!!!

So now my question:
i have one template for all the pages more is not needed, so i think.
but i want to change the picture of every page on the same position in a tag.
so when i click on link1 the picture should be showen of link1 and so on.

is this possible without making a new template for every page where the picture should be changed?

thank you for helping me.
cheers slinux

Re: Changing an Image on every Page

Posted: Fri Dec 29, 2006 3:18 pm
by Dr.CSS
Welcome slinux

You may want to look into the Banners Module...

Re: Changing an Image on every Page

Posted: Fri Dec 29, 2006 4:04 pm
by slinux
thx, that was maybe that i was looking for.
but how can i control that image1.jpg is only displayed in site_image1.php?
thats what i don't understand.

merci for your help.
slinux

Re: Changing an Image on every Page

Posted: Fri Dec 29, 2006 4:20 pm
by calguy1000
You can try something like this in your template

{capture assign="image"}image_{$page_alias}.jpg{/capture}
{image src="$image}

Then, for example if your page alias was 'home', you'd need an:  image_home.jpg in your uploads/images directory.

Re: Changing an Image on every Page

Posted: Fri Dec 29, 2006 4:33 pm
by hok
@slinux

There is also a dedicated TAG for this at http://dev.cmsmadesimple.org/projects/sectionimage/

Have not tried this one myself, but it seems like the right tool to solve your problem. You can decide how many levels to show pictures, and you can specify what folder in uploads/images you will use for storing the images (eg. uploads/images/sectionimages).

Just download, unzip, and place function.sectionimage.php in cmsmsrootfolder/plugins

Then log into admin. Go to Extensions/Tags, and find sectionimage. Click the "Help" link to the right, and you should understand what to do.

Re: Changing an Image on every Page

Posted: Fri Dec 29, 2006 5:00 pm
by slinux
@hok

The idea was good.  ;)
But it don't works, cause it shows the name of the picture an not the picture.
here the script with all options:

Code: Select all

<div class="picture">{sectionimage levels="1" extension="jpg" image_path="/uploads/images" byname="1"}</div>
I don't understand why. Do you?

@calguy
It works, thx a lot.
What would be interesting for me is also using it in connection with flash,
so that also flashfiles can loaded in.

Re: Changing an Image on every Page

Posted: Fri Dec 29, 2006 5:42 pm
by hok
@slinux

Maybe I should have tried this Tag before recommending it:)

The only thing you actually have to do is specify the whole path to your images like so (at least that worked with me).
{sectionimage levels="1" extension="jpg" image_path="http://www.yourdomain.something/uploads/images" byname="1"}
Dont know why this isnt automated in the script, but maybe this would be fixed in future versions:)

Re: Changing an Image on every Page

Posted: Fri Dec 29, 2006 5:55 pm
by slinux
thank you!
next time i try setting a absolut path!  ;D

Re: Changing an Image on every Page

Posted: Fri Dec 29, 2006 6:19 pm
by Dr.CSS
If you have the {metadata} tag in the you may not have to give the full path to the image...

It should give a base tag...