Copied to clipboard

Flag this post as spam?

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


  • Simon 81 posts 184 karma points
    Sep 06, 2011 @ 17:35
    Simon
    0

    Advice about carousels

    Afternoon all,

    I'm a relative newbie to Umbraco although I seem to be getting on with it reasonably well.

    I'd like some advice on the best way to implement a carousel, in particular how best to capture the following details for an unknown number of slides.

    • caption
    • url (from content picker)
    • image (from media picker)

    I'm quite happy generating the HTML for carousel itself - it's the method for capturing the information I'm interested in. I could add a tab to the document type with "slide 1 caption", "slide 1 Url", "slide 1 image" etc. but I don't want to restrict the number of images. Equally I've seen forum posts about creating a mini document type to hold the information. Then add as many of these as required as the children of the main content page and use XSLT to loop through them.

    Any ideas on "best practice" or how other people do it would be much appreciated.

    Cheers

    Simon

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 06, 2011 @ 20:37
    Dirk De Grave
    0

    May have a look into this project, could be exactly what you need.

    As for your question, ... 2nd method is preferred as it's more extensible... Above project does use a slightly different approach...

     

    Cheers,

    /Dirk,

  • Mike Chambers 635 posts 1252 karma points c-trib
    Sep 07, 2011 @ 10:40
    Mike Chambers
    0

    we use a custom mediaType with additional parameters (you would have your caption etc...), as we don't really want the media items as documnets in the hierarchy.

    then the xslt draws all the added custom media types in a specific media folder using a media picker either in the macro or as a doc type parameter...

    the xlst important bit is...

    {!--macro param--}
    <
    xsl:variable name="MediaNodeId" select="/macro/MediaNode/Folder/@id"/>
    or
    {!--doc param--}
    <xsl:variable name="MediaNodeId" select="$currentPage/MediaNode/Folder/@id"/>
    ...
    <xsl:for-each select="umbraco.library:GetMedia($MediaNodeId, 1)/{CUSTOMMEDIATYPE}">
    ...
    </xsl:for-each>
  • Simon 81 posts 184 karma points
    Sep 21, 2011 @ 15:22
    Simon
    0

    Thanks for the replies guys - went with a custom media type in the end with Url, image, caption etc.

    Cheers

    Simon

Please Sign in or register to post replies

Write your reply to:

Draft