Hi there, I am pretty new to Umbraco and have a question about showing media...
On the homepage there is a bar at the bottom in which I want to show pictures or videos... Each media item will consist of a large icon (png), small icon (png), optionally a flash video, optionally an image and optionally a hyperlink.
From my understanding so far, I could create a document type for each homepage media item, then create an XSLT macro that outputs the html for a video player, or gallery etc.
However, I want inner pages to also potentially have different media of the same document type, displayed by the same macro... I would like the media items to be recursive, so if an inner page does not have media items defined it gets it from somewhere up the content tree. I know you can use recursive properties in templates, but can you in macros?
My suggestion would be to create media-types (as opposed to document-types) for your various media item types. Then for your document-type (content pages) use the Tree Multi Picker to select which media items you want to display. This will give you a comma-separated list of media node IDs.
In your Macro (assuming you are using XSLT?), you can use XPath to navigate through the content/node tree - so you can get property data recursively, e.g.
Media
Hi there, I am pretty new to Umbraco and have a question about showing media...
On the homepage there is a bar at the bottom in which I want to show pictures or videos... Each media item will consist of a large icon (png), small icon (png), optionally a flash video, optionally an image and optionally a hyperlink.
From my understanding so far, I could create a document type for each homepage media item, then create an XSLT macro that outputs the html for a video player, or gallery etc.
However, I want inner pages to also potentially have different media of the same document type, displayed by the same macro... I would like the media items to be recursive, so if an inner page does not have media items defined it gets it from somewhere up the content tree. I know you can use recursive properties in templates, but can you in macros?
Is this the right way to go about it?
many thanks
Kris
Hi Kris,
There are a few ways to tackle this...
My suggestion would be to create media-types (as opposed to document-types) for your various media item types. Then for your document-type (content pages) use the Tree Multi Picker to select which media items you want to display. This will give you a comma-separated list of media node IDs.
In your Macro (assuming you are using XSLT?), you can use XPath to navigate through the content/node tree - so you can get property data recursively, e.g.
For displaying the media items in your XSLT, take a look at a couple of my blog post:
Ultimate Picker XSLT Example
How to use umbraco.library GetMedia in XSLT
That should give you a head start! Good luck!
Cheers, Lee.
Hi Lee, thanks v much! I'll read more!
k
is working on a reply...