Copied to clipboard

Flag this post as spam?

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


  • Aron Gamble 63 posts 76 karma points
    Jun 29, 2010 @ 19:38
    Aron Gamble
    0

    GetMedia not working in a clean 4.5 install

    Trying to use GetMedia in a clean install of v4.5 but can't the image out.

    I've tried:-

    <xsl:value-of select="umbraco.library:GetMedia($currentPage/panel1, 'false')/Image/umbracoFile"/>

    But get nothing. If i use this:-

    <xsl:value-of select="umbraco.library:GetMedia($currentPage/panel1, 'true')"/>

    I get:-
    /media/39/home_imiway.jpgjpg12007
    I would check the umbraco.config file but there isn't one there...
    Any ideas?
    Thanks
    Aron

  • Jeff Grine 149 posts 189 karma points
    Jun 29, 2010 @ 19:59
    Jeff Grine
    0

    Umbraco.config is the App_Data folder now.

  • Aron Gamble 63 posts 76 karma points
    Jun 29, 2010 @ 20:04
    Aron Gamble
    0

    Thanks, got it - i'm still no closer to getting GetMedia working though.

     

    Cheers

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Jun 29, 2010 @ 20:08
    Niels Hartvig
    0

    Try <xsl:copy-of select="umbraco.library:GetMedia($currentPage/panel1, 'false')"/> and view source to see what the xml schema looks like...

     

  • Aron Gamble 63 posts 76 karma points
    Jun 29, 2010 @ 20:26
    Aron Gamble
    0

    Niels,
    This is what's getting rendered:-
    <FILE id=1069 path="-1,1068,1069" nodeTypeAlias="File" writerName="Administrator" urlName="panel1" nodeName="Panel 1" updateDate="2010-06-29T17:57:58" createDate="2010-06-29T17:57:58" sortOrder="1" template="0" nodeType="1033" writerID="0" level="2" parentID="1068" version="21c9f2b7-0b7e-4f90-9cda-faccaf53c9fc">
    <UMBRACOFILE>/media/39/home_imiway.jpg</UMBRACOFILE>
    <UMBRACOEXTENSION>jpg</UMBRACOEXTENSION>
    <UMBRACOBYTES>12007</UMBRACOBYTES></FILE>
    Any suggestions?
    Thanks
    Aron

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Jun 29, 2010 @ 20:31
    Niels Hartvig
    0

    All uppercase?

  • Aron Gamble 63 posts 76 karma points
    Jun 29, 2010 @ 20:34
    Aron Gamble
    0

    Yes, but this was through the xslt visualiser. This is what i get from IE View Source:-

    <File id="1069" version="21c9f2b7-0b7e-4f90-9cda-faccaf53c9fc" parentID="1068" level="2" writerID="0" nodeType="1033" template="0" sortOrder="1" createDate="2010-06-29T17:57:58" updateDate="2010-06-29T17:57:58" nodeName="Panel 1" urlName="panel1" writerName="Administrator" nodeTypeAlias="File" path="-1,1068,1069">

    <umbracoFile>/media/39/home_imiway.jpg</umbracoFile>

    <umbracoExtension>jpg</umbracoExtension><umbracoBytes>12007</umbracoBytes></File>

  • jaygreasley 416 posts 403 karma points
    Jun 29, 2010 @ 20:36
    jaygreasley
    0

    there's a similar post here:

    http://our.umbraco.org/forum/developers/xslt/10135-Umbraco-45-umbracolibraryGetMedia-doesn't-return-a-value?p=0

    is it possible to link cases on Our ? It might be a pain and hopefully the recent changes reduce duplication a lot.

    j

  • Aron Gamble 63 posts 76 karma points
    Jun 29, 2010 @ 20:39
    Aron Gamble
    0

    I think that post related to an upgrade this was a clean install downloaded from Codeplex this afternoon. I've tried all combinations of /Image/umbracoFile and i  believe it's using the new schema but i just can't get the umbracoFile property out...

  • Aron Gamble 63 posts 76 karma points
    Jun 29, 2010 @ 20:43
    Aron Gamble
    0

    I'm not sure if this is related but i can't use the Media Picker with Preview datatype either. There's a javascript error when i try and add an image...

  • Jeff Grine 149 posts 189 karma points
    Jun 29, 2010 @ 23:55
    Jeff Grine
    1

    Based on your source, you've got a File media type, not an Image media type. So this should work:

    xsl:value-of select="umbraco.library:GetMedia($currentPage/panel1, 'false')/File/umbracoFile"/>

  • Aron Gamble 63 posts 76 karma points
    Jun 30, 2010 @ 08:05
    Aron Gamble
    0

    Doh! I changed it to an image and it worked! How did i not see that, still worn out from Codegarden i guess. 

    Thanks

    Aron

     

  • Nickolai Parinov 1 post 22 karma points
    Jul 08, 2010 @ 11:54
    Nickolai Parinov
    1

    This didn't work for me:

    xsl:value-of select="umbraco.library:GetMedia($currentPage/panel1, 'false')/File/umbracoFile"/>

     

    But what did is:

    <xsl:value-of select="umbraco.library:GetMedia($galleryRoot/imgFolder, 'true')/descendant-or-self::*[@nodeTypeAlias='File']/umbracoFile"/>

     

     

    That's pretty weird cause File-node is present just like in your sample but nothing is selected when using File in XPath.

Please Sign in or register to post replies

Write your reply to:

Draft