Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kris Dyson 54 posts 79 karma points
    Feb 26, 2010 @ 11:42
    Kris Dyson
    0

    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

     

  • Lee Kelleher 3945 posts 15163 karma points MVP 10x admin c-trib
    Feb 26, 2010 @ 12:24
    Lee Kelleher
    0

    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.

    $currentPage/ancestor-or-self::node[string(data[@alias='mediaNodeIds'])!=''][1]/data[@alias='mediaNodeIds']

    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.

  • Kris Dyson 54 posts 79 karma points
    Feb 26, 2010 @ 12:41
    Kris Dyson
    0

    Hi Lee, thanks v much! I'll read more!

    k

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies