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...
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...
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')"/>
Umbraco.config is the App_Data folder now.
Thanks, got it - i'm still no closer to getting GetMedia working though.
Cheers
Try <xsl:copy-of select="umbraco.library:GetMedia($currentPage/panel1, 'false')"/> and view source to see what the xml schema looks like...
All uppercase?
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>
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
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...
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...
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"/>
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
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.
is working on a reply...