45 votes

Cultiv Razor Examples

I've seen this question many times in the past few months: "Help! How do I use datatype X with Razor?!". This package gives you the answer for the 40 most popular datatypes. Included in this release are:

  • All of the native datatypes built into Umbraco (15 datatypes)
  • All of the uComponents datatypes (23 datatypes)
  • Digibiz Advanced Media Picker (DAMP) datatype
  • Google Maps datatype
There's more to come in the future, both new datatypes and variations on the current datatypes. I also plan to include some good examples of using Razor to select nodes and present your site's data in cool new ways.

This package comes as a pre-installed Umbraco environment with the datatypes fully configured and content setup to use them. It is easy to start using this by opening it in Web Matrix:
  • Download the zip file
  • Don't forget to UNBLOCK the zip in Windows 7!
  • Unzip this into a folder of your choice
  • Right-click the folder and choose "Open as site in Microsoft Web Matrix"
  • Hit the "Run" button in the toolbar at the top 
  • The site should open now
To get access to the backoffice, go to /umbraco/umbraco.aspx and enter the username demo and the password demo.

There are some more Razor goodies built into this site, which you can explore for yourself (the "Cool stuff" node is one of them, now only featuring how you would group nodes).

4.7.1 only!
A word of warning: This only works with the Umbraco Razor engine that will be included in 4.7.1. These examples will not work in 4.7.0.
I can highly recommend upgrading JUST the Razor engine of your site to the future 4.7.1 version (it's been very stable), all you have to do is look for umbraco.MacroEngines.dll in this package and copy it over to your own site's /bin folder and you're done.

I'm always monitoring the Razor forum.


  • Added events with grouping (by type and in groups of 3)

  • Replaced .GetPropertyValue("prop") != string.Empty with the more elegant .HasValue("prop")

  • Replace the truncate helper with the built-in Library.Truncate method

  • Upgrade to 4.7.1 final release

  • Added breadcrumbs 
  • Added gallery on the homepage
  • Added navigation that indicates if you're on a page in the menu (or on a childpage of that menu item)
  • Implemented an attractive template


Package owner

Sebastiaan Janssen

Sebastiaan Janssen

Sebastiaan has 15513 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions:

Package Information

  • Package owner: Sebastiaan Janssen
  • Created: 07/09/2011
  • Current version 1.5.0
  • License MIT
  • Downloads on Our: 5.3K

External resources