Changing an Image on every Page

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
slinux
Forum Members
Forum Members
Posts: 19
Joined: Fri Dec 29, 2006 1:22 pm

Changing an Image on every Page

Post 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
Last edited by reneh on Tue Sep 23, 2008 9:00 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Changing an Image on every Page

Post by Dr.CSS »

Welcome slinux

You may want to look into the Banners Module...
slinux
Forum Members
Forum Members
Posts: 19
Joined: Fri Dec 29, 2006 1:22 pm

Re: Changing an Image on every Page

Post 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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Changing an Image on every Page

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
hok

Re: Changing an Image on every Page

Post 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.
slinux
Forum Members
Forum Members
Posts: 19
Joined: Fri Dec 29, 2006 1:22 pm

Re: Changing an Image on every Page

Post 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.
hok

Re: Changing an Image on every Page

Post 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:)
slinux
Forum Members
Forum Members
Posts: 19
Joined: Fri Dec 29, 2006 1:22 pm

Re: Changing an Image on every Page

Post by slinux »

thank you!
next time i try setting a absolut path!  ;D
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Changing an Image on every Page

Post 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...
Post Reply

Return to “CMSMS Core”