XSLT Parsing error when using Umbraco GetMedia -


i trying retrieve url image using getmedia mediapicker.

the code below works fine:

<xsl:for-each select="umbraco.library:getxmlnodebyid(1123)/* [@isdoc]">   <article>      <img width="1822" height="600">        <xsl:attribute name="src">          <xsl:value-of select="umbraco.library:getmedia(1139, 0)/umbracofile" />        </xsl:attribute>      </img>      <div class="contents">         <h1>           <xsl:value-of select="bannerheading1"/>         </h1>       </div>   </article> </xsl:for-each> 

however, if replace key line this:

<xsl:value-of select="umbraco.library:getmedia(bannerimage, 0)/umbracofile" /> 

i parsing error exception being overflowexception (value either large or small int32), suggests it's not 1139 being passed in.

is there way can pass in property want? value of "bannerimage" 1139 want be?

thanks help.

further: xml structure being returned getxmlnodebyid:

<?xml version="1.0" encoding="utf-8" ?> <homepagebanner id="1141" parentid="1123" level="3" writerid="0" creatorid="0" nodetype="1124" template="1125" sortorder="0" createdate="2013-08-12t15:53:48" updatedate="2013-08-12t15:54:18" nodename="members" urlname="members" writername="admin" creatorname="admin" path="-1,1065,1123,1141" isdoc="">   <bannerimage>1139</bannerimage>   <bannerheading1>members area</bannerheading1>   <bannerheading2>..the place needs</bannerheading2> </homepagebanner> 

for else trying image item in content folder, how got work:

<xsl:for-each select="umbraco.library:getxmlnodebyid(1123)/* [@isdoc]">   <article>     <!-- store id -->     <xsl:variable name="mediaid" select="bannerimage" />       <!-- check id numeric -->       <xsl:if test="number($mediaid) &gt; 0">         <xsl:variable name="medianode" select="umbraco.library:getmedia($mediaid, false())" />         <xsl:if test="string-length($medianode/umbracofile) &gt; 0">           <img src="{$medianode/umbracofile}" width="1822" height="600" />           <div class="contents">             <h1>               <xsl:value-of select="bannerheading1"/>             </h1>           </div>         </xsl:if>       </xsl:if>     </article> </xsl:for-each> 

you first need check value numeric , then, bit failing me, need add "/umbracofile" part media node variable.

thanks contributors helped me in right direction.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -