Has anyone gotten this to work in multiple environments?
We're using a three tier environment -- devl, modl, prod. I have gotten this picker to work well in a single environment, but when I publish content and media from one environment to another, the node id's no longer match up. This causes my images to not come up as expected using the Tree Multi Picker. This hasn't been an issue for us with the standard picker. Here is the XSLT I'm using:
Of course there might be changes to config files that could cause this. Any difference in the web.config or umbracosettings.config other than the database connection string and debugging settings?
Has anyone gotten this to work in multiple environments?
We're using a three tier environment -- devl, modl, prod. I have gotten this picker to work well in a single environment, but when I publish content and media from one environment to another, the node id's no longer match up. This causes my images to not come up as expected using the Tree Multi Picker. This hasn't been an issue for us with the standard picker. Here is the XSLT I'm using:
<?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"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:math="urn:schemas-hizi-nl:math"
xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings"
xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath"
exclude-result-prefixes="msxml Exslt.ExsltMath Exslt.ExsltStrings math umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<msxml:script language="JavaScript" implements-prefix="math">
function random(numDie,numMax,numMin){
if (numMin==null){numMin=1;}
var sum=0;
for (var index=0;index<numDie;index++){
sum+=Math.floor(Math.random()*(numMax-numMin) + numMin);
}
return "" + sum;
}
function floorme(numFloor){
return "" + Math.floor(numFloor);
}
</msxml:script>
<xsl:template match="/">
<xsl:variable name="images" select="$currentPage/data[@alias='rotatingImages']"/>
<xsl:if test="$images != ''">
<xsl:variable name="splitDocs" select="umbraco.library:Split($images, ',')" />
<xsl:variable name="random" select="math:random(1, count($splitDocs/value)+1, 1)"/>
<xsl:for-each select="$splitDocs/value">
<xsl:if test="position()=$random">
<xsl:if test=". != ''">
<xsl:variable name="mediaNode" select="umbraco.library:GetMedia(.,0)"/>
<xsl:if test="$mediaNode != ''">
<img src="{$mediaNode/data [@alias='umbracoFile']}" alt="{$mediaNode/@nodeName}"/>
</xsl:if>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Forgot to place in code:
Did you reseed the database between environments?
Of course there might be changes to config files that could cause this. Any difference in the web.config or umbracosettings.config other than the database connection string and debugging settings?
We didn't reseed -- using Courier to publish media files.
No differences in config files other than connection strings.
Well, it looks like courier is just changing the media Id's then.. You should probably have a talk with Courier support about this!
is working on a reply...