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
In XSLT I do something like this:umbraco.library:GetMedia(propertyName, 0)/crops//crop [@name = 'cropName']/@url
But how do I get a specific crop in a .NET user control?
/m
Hello Mathias,
You could use something like that:
@usingSystem.Xml@functions{ publicstaticstringGetImageCropperUrl(string cropText,string cropName) { string cropUrl =string.Empty; XmlDocument xmlDocument =newXmlDocument(); xmlDocument.LoadXml(cropText); XmlNode cropNode = xmlDocument.SelectSingleNode("descendant::crops/crop[@name='"+ cropName +"']"); if(cropNode !=null) { cropUrl = cropNode.Attributes.GetNamedItem("url").InnerText; } return cropUrl; }}
Or just use such package:
http://our.umbraco.org/projects/backoffice-extensions/create-crops
Very good article about Images in Umbraco:http://24days.in/umbraco/2012/introducing-the-umbraco-image-control/
Thanks Alex! Couldn't find any documentation on this. So this is just what I needed! I'll try it out later.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to get image crop in .NET?
In XSLT I do something like this:
umbraco.library:GetMedia(propertyName, 0)/crops//crop [@name = 'cropName']/@url
But how do I get a specific crop in a .NET user control?
/m
Hello Mathias,
You could use something like that:
Or just use such package:
http://our.umbraco.org/projects/backoffice-extensions/create-crops
Very good article about Images in Umbraco:
http://24days.in/umbraco/2012/introducing-the-umbraco-image-control/
Thanks Alex! Couldn't find any documentation on this. So this is just what I needed! I'll try it out later.
is working on a reply...