Please forgive how basic this question is. Bought the book, searched the forums, watched the videos, and still learning how to do this.
How do we create a website page that has an image which can be changed by the user? Don't want to use the rich text editor, just want a link somewhere on the content section that sez "upload the image for your page". It looks like we need to use some xslt to extract the content node for the image, but I am not clear on the procedure. What do we need to add? Using Umbraco 4.7, all ideas greatly appreciated.
<xsl:template match="/"> <!-- check to make sure the property value that we pass in is not empty --> <xsl:if test="$propertyValue!=''"> <!-- localize the media nodeset into a shorter variable name for readability --> <xsl:variable name="mediaItem" select="umbraco.library:GetMedia($propertyValue, 'false')"/> <xsl:if test="$mediaItem!=''"> <img> <xsl:attribute name="src"> <xsl:value-of select="$mediaItem/umbracoFile" /> </xsl:attribute> <xsl:attribute name="width"> <xsl:value-of select="$mediaItem/umbracoWidth" /> </xsl:attribute> <xsl:attribute name="height"> <xsl:value-of select="$mediaItem/umbracoHeight" /> </xsl:attribute> <xsl:attribute name="alt"> <xsl:value-of select="$mediaItem/@nodeName" /> </xsl:attribute> </img> </xsl:if> </xsl:if> </xsl:template>
Hi, there. The only thing I can think of is that you don't have your macro paramters setup correctly. Make sure you have a macro parameter with an Alias of propertyAlias set in your Paramaters tab found in the details of the macro that drives the above XSLT file.
How to work with images?
Please forgive how basic this question is. Bought the book, searched the forums, watched the videos, and still learning how to do this.
How do we create a website page that has an image which can be changed by the user? Don't want to use the rich text editor, just want a link somewhere on the content section that sez "upload the image for your page". It looks like we need to use some xslt to extract the content node for the image, but I am not clear on the procedure. What do we need to add? Using Umbraco 4.7, all ideas greatly appreciated.
Realized a bit more info might help... here is the master page:
...and here is quite a simple document type:
...and here is the xslt:
What are we missing please?
Hi, there. The only thing I can think of is that you don't have your macro paramters setup correctly. Make sure you have a macro parameter with an Alias of propertyAlias set in your Paramaters tab found in the details of the macro that drives the above XSLT file.
Your script looks valid otherwise...
HTH,
Nik
is working on a reply...