Top 5 Umbraco Tips I wish I knew when starting out – Part 1

Custom indexes

Search indexes can be a tricky subject for new Umbraco users, but they are one of the most powerful features available to us. Umbraco comes with some build in search index that allow us to search all content or members, these are useful, but the real power comes when utilizing your own indexes.

The configuration options for both Umbraco 7 and 8 let us set up indexes to not only search document types but also specific areas of sites and even build a totally bespoke index when saving a content item via events.

You don’t just have to use Examine for search functionality on the front end, you can replace complex content queries with an index and hugely decrease the query run time. If you’re stuck when it comes to setting up indexes check out our article on filtered search on Umbraco 7.

Image cropper

Correct image sizing and format is a perennial problem with web content, hours of page size optimization can be rendered pointless by one 10mb header image if we aren’t careful!

Thankfully Umbraco provides a handy way to combat this image bloat. The image cropper backed by the .NET Image Processor lets us render any media with a bunch of option to crop, reduce quality, set focus the point and many more. It also lets content editors set the focus point and set predefined crops in the back office, so we don’t get half of someone’s face cut off or an image that’s 90% sky.

Extending partial content models

The Umbraco model’s builder provides a very useful way of strongly typing document types with generated models so we can have compile time checking on our CMS properties. The generated classes are marked with the ‘partial’ keyword, this means we can create another class with the same name (also marked ‘partial’) to add extra functionality to the generated classes.

For example, you could add some methods to the build in “File” media type to return the mimetype and size of the file.

CMS events

Almost everything you do in the CMS creates an event that you can subscribe to in your code. From saving and publishing to re-indexing or rendering trees you can run your own custom code when these things happen. The sky is the limit with what you can do when subscribing to an event but validation, automatic content creation and notifications are some useful options.

Azure image storage

When pushing content between dev, staging and live environments media can often be frustrating as large volumes can be very slow to transfer or cause timeouts. Luckily for us Umbraco provides a mechanism for storing media in azure cloud storage container. This means if we connect all our environments to the same container the media will automatically be shared by each environment rather than having to push it from one to another.

back to blog

Related posts