How to dynamically change banner / background image based on page.
Hello all. Before we begin, I am an experienced C# developer, but regrettably a complete Umbraco newb. This is my first attempt at installing this CMS in a site, so please forgive me if I'm asking a stupid question or posting in the wrong place.
That being said, I am trying to dynamically change the banner based on the page. I would like the user to be able to select an image (or upload a new one) and have that dynamically set that on the page load. What's the best way to accomplish this? So far, I have added a "Generic Property" called "Background Image" of type "Media Picker". I have yet to figure out:
how to upload images into the media folder, (When I click media, no options are displayed?) or to
how to set div background on the master page to the image value
I think it's important to understand how Umbraco works. To accomplish your task you have to:
create document type with a media picker control
create a template
create a macro(xslt/usercontrol) to pick up the value from the
documenttype
create a node based upon the document type
use the template from step 2 to render the node
run the page
The fun is in the third step, to create the actual logic. This can be done by xslt or just a usercontrol using the umbraco API.
There are lost of samples posted in this forum to retreive the image selected in the node. The easiest way is to use xslt for selecting the background.
Umbraco.tv is your friend if you're new to Umbraco. Watch a few tutorial videos on document types, templates and macros (it'll take about an hour or so to get through the key ones) then you'll be completely set. Once you get your head around the key concepts, it's an absolute piece of cake.
I have learned a little about XSLT and Custom Controls, but I have failed to find any documentation on where in the XML I'm supposed to transform the page's (node's ?) properties come from.
The same comment applies to Custom Controls & .NET. I have learned how to create a custom control and macro, but have yet to see it interact with the page data structure. The only possibility, would be for Umbraco to pass the page id into my control as a property, and I would query the database for the filename directly based of the page id.
I think you should install a starterkit from the package repository and try to understand how things work. take a look at the templates, the macro's the xslt files and the usercontrols. Read tutorials in the document section and look at the great video's found on the Umbraco site.
How to dynamically change banner / background image based on page.
Hello all. Before we begin, I am an experienced C# developer, but regrettably a complete Umbraco newb. This is my first attempt at installing this CMS in a site, so please forgive me if I'm asking a stupid question or posting in the wrong place.
That being said, I am trying to dynamically change the banner based on the page. I would like the user to be able to select an image (or upload a new one) and have that dynamically set that on the page load. What's the best way to accomplish this? So far, I have added a "Generic Property" called "Background Image" of type "Media Picker". I have yet to figure out:
Any help with this topic would be appreciated. Tx
I think it's important to understand how Umbraco works. To accomplish your task you have to:
The fun is in the third step, to create the actual logic. This can be done by xslt or just a usercontrol using the umbraco API.
There are lost of samples posted in this forum to retreive the image selected in the node.
The easiest way is to use xslt for selecting the background.
Hi Matt,
Umbraco.tv is your friend if you're new to Umbraco. Watch a few tutorial videos on document types, templates and macros (it'll take about an hour or so to get through the key ones) then you'll be completely set. Once you get your head around the key concepts, it's an absolute piece of cake.
HTH
I have learned a little about XSLT and Custom Controls, but I have failed to find any documentation on where in the XML I'm supposed to transform the page's (node's ?) properties come from.
The same comment applies to Custom Controls & .NET. I have learned how to create a custom control and macro, but have yet to see it interact with the page data structure. The only possibility, would be for Umbraco to pass the page id into my control as a property, and I would query the database for the filename directly based of the page id.
Is there something I'm missing? Thanks again.
I think you should install a starterkit from the package repository and try to understand how things work. take a look at the templates, the macro's the xslt files and the usercontrols. Read tutorials in the document section and look at the great video's found on the Umbraco site.
is working on a reply...