umbraco.library:GetMedia 3 to 4.5 schema transition not working
Hi all,
I have a few xslt files from version 3 that I am trying
to get working with the new 4.5 schema. The files did work with version
4 but I am having some errors and now having trouble updating the xslt.
Here is the page source:
First thing to check, does the variable $image contains info about the image from the media section?
Suggesting to add a <textarea><xsl:value-of select="umbraco.library:GetMedia('1221',0)" /></textarea> to see if there's info available. Also, when upgraded, check the path where umbraco.config is going? May be different as the latest umbraco version puts it in the /App_Data folder rather than the /data folder. Also try to republish every single top level node and perform a republish all on the 'Content' node and check whether data gets returned now.
Thanks for the reply. I tried putting the xsl call in a textarea and it came out empty. Also I compared the two umbraco.config files and they were slightly different. Tried replacing the app_data config file with the data folder config file but nothing changed.
In the end I restored my 4.0.4.2 backup and upgraded to 4.5.1 instead of 4.5.2 and everything worked great - including the "create" problem in the other thread.
Sorry I can't be of any help to anybody else referencing the same problem but I just don't have the time to try and fix the error for other people. I did see somebody mention that a change in the database schema might mean the new schema isnt finding the images in the database because they were uploaded with the old schema. Not sure if this helps but it might be of some use to somebody :)
umbraco.library:GetMedia 3 to 4.5 schema transition not working
Hi all,
I have a few xslt files from version 3 that I am trying to get working with the new 4.5 schema. The files did work with version 4 but I am having some errors and now having trouble updating the xslt. Here is the page source:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:variable name="prodID"><xsl:value-of select="$currentPage/Image"/></xsl:variable>
<div id="ProductImage">
<xsl:attribute name="style">background-image:url('<xsl:value-of select="umbraco.library:GetMedia($prodID, 0)/umbracoFile"/>');height:<xsl:value-of select="umbraco.library:GetMedia(1221, 0)/umbracoHeight"/>px;</xsl:attribute>
<div id="prodText">
<xsl:value-of select="$currentPage/SplashText" disable-output-escaping="yes"/>
</div>
</div>
</xsl:template>
</xsl:stylesheet>
Here are a few examples of xslt snippets i have found and tried with no luck as of yet:
<xsl:variable name="image" select="umbraco.library:GetMedia(1221, false())" /><xsl:value-of select="$image/umbracoFile" />
<xsl:value-of select="umbraco.library:GetMedia('1221', 'false')/*/data [@alias = 'umbracoFile']" />
<xsl:variable name="prodID"><xsl:value-of select="$currentPage/Image"/></xsl:variable>
<xsl:value-of select="umbraco.library:GetMedia($prodID, 0)/umbracoFile"/>
Can anybody see where I am going wrong?
Thanks.
Max.
Anybody? I'm very stuck :(
First thing to check, does the variable $image contains info about the image from the media section?
Suggesting to add a <textarea><xsl:value-of select="umbraco.library:GetMedia('1221',0)" /></textarea> to see if there's info available. Also, when upgraded, check the path where umbraco.config is going? May be different as the latest umbraco version puts it in the /App_Data folder rather than the /data folder. Also try to republish every single top level node and perform a republish all on the 'Content' node and check whether data gets returned now.
Looking forward to your info.
Cheers,
/Dirk
Hi,
Thanks for the reply. I tried putting the xsl call in a textarea and it came out empty. Also I compared the two umbraco.config files and they were slightly different. Tried replacing the app_data config file with the data folder config file but nothing changed.
In the end I restored my 4.0.4.2 backup and upgraded to 4.5.1 instead of 4.5.2 and everything worked great - including the "create" problem in the other thread.
Sorry I can't be of any help to anybody else referencing the same problem but I just don't have the time to try and fix the error for other people. I did see somebody mention that a change in the database schema might mean the new schema isnt finding the images in the database because they were uploaded with the old schema. Not sure if this helps but it might be of some use to somebody :)
Anyway. thanks for your time and help though,
Max.
For future readers with the same issue, try:
Yourwebsite.com/Umbraco/dialogs/republish.aspx?xml=true
is working on a reply...