Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi there
Been searching and found alot on the subject, but alas, no solution in my case...
I have set up a crop-function and what i need to do, is simply display a cropped image selected via the media picker on a page.
I can get it to display the id of the picture, and from looking in the forum I even got the image displayed... But I need the cropped version.
So I assume I need to make an Xslt Macro?!
From an earlier project the following Xslt displays a list of images:
<xsl:template match="/"><ul> <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']"> <li> <xsl:if test="forsidebillede != ''"> <xsl:variable name="myPic" select="umbraco.library:GetMedia(forsidebillede,'false')/umbracoFile" /> <img src="{concat(substring-before($myPic,'.'),'_FrontSlide.',substring-after($myPic,'.'))}" border="0" alt="{@nodeName}" /> </xsl:if> </li></xsl:for-each></ul> </xsl:template>
forsidebillede = alias propertyFrontSlide = crop
I tried "modding" this to just show one picture but without any luck...
Any ideas out there?
Yeee... i solved it myself :)
<xsl:template match="/"> <xsl:variable name="mediaId" select="number($currentPage/billede)" /> <xsl:if test="$mediaId > 0"> <xsl:variable name="mediaNode" select="umbraco.library:GetMedia($mediaId, 0)" /> <xsl:if test="$mediaNode/umbracoFile"> <img src="{concat(substring-before($mediaNode/umbracoFile,'.'),'_FrontSlide.',substring-after($mediaNode/umbracoFile,'.'))}" border="0" alt="{@nodeName}" /> </xsl:if> </xsl:if> </xsl:template>
Thx for posting your solution, it came in handy :D
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Display Cropped image from Media Picker
Hi there
Been searching and found alot on the subject, but alas, no solution in my case...
I have set up a crop-function and what i need to do, is simply display a cropped image selected via the media picker on a page.
I can get it to display the id of the picture, and from looking in the forum I even got the image displayed... But I need the cropped version.
So I assume I need to make an Xslt Macro?!
From an earlier project the following Xslt displays a list of images:
<xsl:template match="/">
<ul>
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<xsl:if test="forsidebillede != ''">
<xsl:variable name="myPic" select="umbraco.library:GetMedia(forsidebillede,'false')/umbracoFile" />
<img src="{concat(substring-before($myPic,'.'),'_FrontSlide.',substring-after($myPic,'.'))}" border="0" alt="{@nodeName}" />
</xsl:if>
</li>
</xsl:for-each>
</ul>
</xsl:template>
forsidebillede = alias property
FrontSlide = crop
I tried "modding" this to just show one picture but without any luck...
Any ideas out there?
Yeee... i solved it myself :)
<xsl:template match="/">
<xsl:variable name="mediaId" select="number($currentPage/billede)" />
<xsl:if test="$mediaId > 0">
<xsl:variable name="mediaNode" select="umbraco.library:GetMedia($mediaId, 0)" />
<xsl:if test="$mediaNode/umbracoFile">
<img src="{concat(substring-before($mediaNode/umbracoFile,'.'),'_FrontSlide.',substring-after($mediaNode/umbracoFile,'.'))}" border="0" alt="{@nodeName}" />
</xsl:if>
</xsl:if>
</xsl:template>
Thx for posting your solution, it came in handy :D
is working on a reply...