Archive for May 2014

Fetching image cropper cropped file path
IPublished content extension for getting crop image file easily
ImageCropper datatype was once part of uComponents, but because it is so usefull, it is now included into standard Umbraco instalation. However as much it is useful, I could not find the way to get cropped image file properly with anything that was shipped with Umbraco installation. Therefore I decided to write my own extension and to make life easier while working with ImageCropper in Umbraco. ... read more
Enumerable Tips & Tricks with String and Int
Useful things to do with Enumerable in a single line
System.Linq.Enumerable is a core of LINQ magic. Most of the functions we use in a daily basis for anything we write with sequence, but what is really interesting is that methods from this class can be used for some tricky operations on strings and numbers and make them one line instead of loops. ... read more
Forcing accept type for WebApi call
Setting accept type on the server side for the WebApi request
One of the coolest things of WebApi is that adapts to accept type sent in request header. This header value depends on a client. Based on this WebApi will serve different formats of data (XML/JSON). ... read more
Extending WebForms Page class for registering stylesheet include
Extension method which enables registering stylesheet file reference
I recently started working on an Umbraco package for GoogleMap manipulation. Since initial version of package is planned only for Umbraco 6 I decided to use WebuserControl for creating a package custom datatype. It means that for one document type I might have multiple control instances on the page. ... read more
JSON error when loading HTML content with AJAX using $.get
Forcing datatype when loading content with AJAX
I'm currently working on a package for Umbraco which involves loading of some HTML forms dynamically with AJAX. Biggest part of the package relies on JavaScript, so everything in script has to be perfect in order to make package work properly. Therefore I started development of JavaScript library independetly of the rest of the package logic... read more
Exposing richtext property from content in Umbraco Web Api
Problem when exposing richtext property from Umbraco through Web Api
Almost every content page in your website will have one richtext property for adding rich content for the page. This allows you to add Macros so you can render dynamic content inside page content at custom places in the page itself. ... read more
Hide property in Umbraco
How to hide property in Umbraco backend
There is no option for hiding a property in Umbraco. Simply, when you define a property for document type, it is assumed that you are going to use it. However, sometime you need to hide it for some specific condition, like level of document in a tree, or document type which might inherits some property which you do not want to use in inherited document type... read more
Optimized media serving in Umbraco by creating media CDN
Reduce bandwidth with serving from one domain
Let's say you have multiple websites with different domains in one Umbraco instance. All websites will use the same media, but the catch is how will it serve them. For example the same image will be served to a browser with two different paths like the following: ... read more
Reading Umbraco dictionary item in Ajax request
The workaround for getting proper dictionary value in Ajax request
You probably had to make some Ajax call in your Umbraco website. This is really easy in versions star6ting from version six and above... read more
JQuery .onchange issue in IE8
Solution for onchange event in old Internet Explorer versions
Apparently IE8 and older versions of IE browsers do not support JQuery onchange event for checkboxes and radio buttons. If you are using this for handling this event, your script will fail, because these events will not be fired on IE8 or older IE. Instead of this you can add handler for onclick event which works fine in pretty much any browser. ... read more