I am new to umbraco, so exuse me if this is a dumb question. I've already spent too many hours on google trying to fugure out how to do this simple task, but couldn't get to a right direction.
Here's what i am trying to do:
The home page of the website has 3-4 'placeholders' which will display images(banner ads), simple images inside <a> tag. Client should be able to change those images.
I'm kind of lost between all those macro, xslt, media types and everything. I was thinking of something like:
1) there are predefined images for all different plaeholders like 'banner1', 'banner2' etc. Whenver client wants to change the image displayed in the postion of banner1 he/she edit the 'media' file called 'banner1' and uploads a different image
2) then in the page template those images are included through a macro or something
That's what i've understood, but dont know how on earth to do that!!
Like most things in umbraco there are several ways to do, what you are trying to do.
The easiest way to start, is to add 3-4 "upload" propreties to you Homepage-document type. You could call the properties Image1, Image2, and so on... Then you go to you Homepage-node and upload actual images via the upload-mechanism - and then save a publish. Now go to you Homepage-template and click the icon for "insert umbraco page field" - from the list, choose "Image1" or whatever you called your property. (this will give you the path to the image)
You can the wrap the page field into and img tag, and then you have a image on the frontpage. Like so:
Hi, Hundebol thank you so much. I did what you suggested but i've run into one small problem. <img src="<umbraco:Itemfield="mainImage"runat="server"/>" /> gives me something like <img src="7451" /> which i believe is the id of the image node (instead of image's url). I've run into this problem more than once. Few days back i was instaling nivoslider plugin for umbraco, even there i'd get image id's instead of url. So is it something which i am not doing the right way??
You have probably chosen a Media Picker, right? You need to choose an "upload"-control instead - this will give you the full path. Media Pickers gives you the image-id, which is a bit harder to deal with in templates.
you can create a folder in your media section for each banner type
create a custom media type that has a few fiels:
(checkbox) with the name "Active campaign"
text field 'Hyperlink' with validation for a URL
checkbox "open in new window" (can appent a "target=blank" property to the hyperlink
If you then create a little xslt or razor script for each set of banners that'll randomly select an active image from the selected folder, you'll actually have some variation in your website, and your content managers will be able to manage the banner campaigns more easily. Specially if you have to do with multiple languages on your website a solution like this is more interesting.
Dynamic banner images
Hello people,
I am new to umbraco, so exuse me if this is a dumb question. I've already spent too many hours on google trying to fugure out how to do this simple task, but couldn't get to a right direction.
Here's what i am trying to do:
The home page of the website has 3-4 'placeholders' which will display images(banner ads), simple images inside <a> tag. Client should be able to change those images.
I'm kind of lost between all those macro, xslt, media types and everything. I was thinking of something like:
1) there are predefined images for all different plaeholders like 'banner1', 'banner2' etc. Whenver client wants to change the image displayed in the postion of banner1 he/she edit the 'media' file called 'banner1' and uploads a different image
2) then in the page template those images are included through a macro or something
That's what i've understood, but dont know how on earth to do that!!
Any help is greately appreciated!
Thanks.
Hi, and welcome to Our,
Like most things in umbraco there are several ways to do, what you are trying to do.
The easiest way to start, is to add 3-4 "upload" propreties to you Homepage-document type. You could call the properties Image1, Image2, and so on...
Then you go to you Homepage-node and upload actual images via the upload-mechanism - and then save a publish.
Now go to you Homepage-template and click the icon for "insert umbraco page field" - from the list, choose "Image1" or whatever you called your property. (this will give you the path to the image)
You can the wrap the page field into and img tag, and then you have a image on the frontpage. Like so:
best regards
Brian
Hi, Hundebol thank you so much. I did what you suggested but i've run into one small problem. <img src="<umbraco:Itemfield="mainImage"runat="server"/>" /> gives me something like <img src="7451" /> which i believe is the id of the image node (instead of image's url). I've run into this problem more than once. Few days back i was instaling nivoslider plugin for umbraco, even there i'd get image id's instead of url. So is it something which i am not doing the right way??
Hi,
You have probably chosen a Media Picker, right? You need to choose an "upload"-control instead - this will give you the full path. Media Pickers gives you the image-id, which is a bit harder to deal with in templates.
yes!! that worked. thanks
Great! And no problem - there are several other ways to do this, but this is the easiest.
Remember to mark you question solved, to help others find solved problems.
have a nice day, best regards,
hundebol
advanced suggestion:
If you then create a little xslt or razor script for each set of banners that'll randomly select an active image from the selected folder, you'll actually have some variation in your website, and your content managers will be able to manage the banner campaigns more easily. Specially if you have to do with multiple languages on your website a solution like this is more interesting.
is working on a reply...