I can save it but on the page when previewing the content it shows the line "error parsing... xslt file..." where the macro should be showing the resource Item.
I have made progress. Once I selected a document with the media picker for the first resource item it displayed each item with a link to that one resource item. There's more work to be done to make sure it gets the document associated with each item.
can't get url of file from media picker
I can't seem to get the url for a file chosen from a media picker. Here is the xslt. Using Umbraco 4.5.2 .
<xsl:variable name="srcItemsRoot" select="umbraco.library:GetXmlNodeById($currentPage/@id)"/>
<xsl:if test="count($srcItemsRoot/ResourceItem) != 0">
<div class="post">
<h3>Resources</h3>
<table class="">
<xsl:for-each select="$srcItemsRoot/ResourceItem [@isDoc]">
<xsl:variable name="srcItemName" select="resourceItemName"/>
<xsl:variable name="srcDocURL" select="resourceDocument"/>
<xsl:variable name="srcItemDesc" select="itemDescription"/>
<tr>
<td>
<!-- the line below generates the parse error -->
<xsl:value-of select="umbraco.library:GetMedia($srcItemsRoot/ResourceItem/resourceDocument, 0)/umbracoFile"/>
<a href="{$srcDocURL}"><xsl:value-of select="resourceItemName"/></a></td>
</tr>
<xsl:if test="$srcItemDesc != ''">
<tr>
<td><xsl:value-of disable-output-escaping="yes" select="itemDescription"/></td>
</tr>
</xsl:if>
<tr>
<td></td>
</tr>
</xsl:for-each>
</table>
<br/>
</div>
</xsl:if>
Try wrapping the offending line in a test to see if ti has a value, this (should) get around the parsing error and allow you to save:
I can save it but on the page when previewing the content it shows the line "error parsing... xslt file..." where the macro should be showing the resource Item.
I have made progress. Once I selected a document with the media picker for the first resource item it displayed each item with a link to that one resource item. There's more work to be done to make sure it gets the document associated with each item.
How about something like this.
Thank you! That worked.
is working on a reply...