Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Mar 02, 2010 @ 08:47
    Tom
    0

    Ultimate Content Picker + Media?

    Hi Guys,

    I'm picking a bunch of files using the ultimate picker and for the life of me can't actually output anything to do with the files.. i've tried getmedia and now am back on get node by id.. does anyone have an example of how to display medai with the ultimate picker??

     

    <xsl:for-each select="$insuranceServices">
                <xsl:if test="umbraco.library:IsProtected(@id, @path) = 0 or (umbraco.library:IsProtected(@id, @path) = 1 and umbraco.library:IsLoggedOn() = 1 and umbraco.library:HasAccess(@id, @path) = 1)">
                <xsl:variable name="ultimatePickerContent" select="umbraco.library:Split(data [@alias = 'pageFileAttachments'],',')" />
                    <div>
                        <xsl:attribute name="class">
                            <xsl:value-of select="umbraco.library:Replace(@nodeName, ' ', '-')"/>
                        </xsl:attribute>
                        <xsl:value-of select="data[@alias='bodyText']" disable-output-escaping="yes"/>
                        <xsl:for-each select="$ultimatePickerContent">
                        <div>
                                <p><strong><xsl:value-of select="umbraco.library:GetXmlNodeById(.)/data[@alias='umbracoFile']" /></strong></p>
                        </div>

                        </xsl:for-each>
                        <a href="{umbraco.library:NiceUrl(@id)}">
                            <xsl:attribute name="class">
                                <xsl:value-of select="umbraco.library:Replace(@nodeName, ' ', '-')"/>
                            </xsl:attribute>
                            <xsl:value-of select="@nodeName"/>
                        </a>
           
                    </div>
                </xsl:if>
            </xsl:for-each>

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Mar 02, 2010 @ 09:10
    Dirk De Grave
    0

    Hi Tom,

    I never reminder how datatypes store data... but I always use a simple trick to find out what is stored... using <xsl:copy-of> or putting the *unknown* factor in a <textarea> field

    So, what's the outcome of

    <xsl:for-each select="$ultimatePickerContent">
    <textarea><xsl:value-of select="." /></textarea>
    </xsl:for-each>

    when viewing in a browser?

    It's probably the id of a media item... so, if you need the file reference of the media item, you'd need

    <xsl:value-of select="umbraco.library:GetMedia(@id, '0')/data [@alias = 'umbracoFile']" />

    If it's a content item, you'd get the info about this item using your GetXmlNodeById() method

    Hope this helps.

    Regards,

    /Dirk

  • Tom 713 posts 954 karma points
    Mar 03, 2010 @ 01:58
    Tom
    0

    Hi Dirk!

    thanks so much! worked like a charm! most appreciated!

  • Tom 713 posts 954 karma points
    Mar 03, 2010 @ 01:59
    Tom
    0

    actually alas! @id i get an error saying

    System.OverflowException: Value was either too large or too small for an Int32.
    at System.Convert.ToInt32(Double value)
    at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)

     

    any help?

  • Tom 713 posts 954 karma points
    Mar 03, 2010 @ 02:03
    Tom
    0

    the split doesn't seem to be working i'm only getting one text area with one string of nodeids all joint togehter ie 106510661067  instead of

    <textarea>1065</textarea><textarea>1066</textarea><textarea>1067</textarea>

     

    very odd!

  • Tom 713 posts 954 karma points
    Mar 03, 2010 @ 02:05
    Tom
    0

    ahh sorry! fixed it needed to be <xsl:for-each select="$ultimatePickerContent/value">

Please Sign in or register to post replies

Write your reply to:

Draft