6 votes

Razor Scaffold

Razor Scaffold provides an analog of XSLT apply-templates in Razor by dynamic binding in a developer conscious manner. It aims to provide a better way of structuring presentation logic on your Umbraco projects. 

Razor Scaffold enables you to write your templates in a modular way. Imagine you have an Event document type, a template for rendering this nodes would be:

@helper Event(dynamic eventNode){
     <span>@eventNode.title</span>
     <cite>@eventNode.date</cite>     <a href="@eventNode.Url">read more</a>}

You should have this helper definition inside in any Razor script file in the ~/macroScripts/Scaffold/ dir.

Then anywhere in your code you want to render an Event node you will just need to do:

@RazorScaffold.Render(eventNode);

This is basically what it does, what it enables you to do is much more interesting. I've extended Cultiv's razor examples and implemented XSLT's guru Chriztian Steinmeier use case of the multi-node tree picker (http://pimpmyxslt.com/articles/multipicker/). You can download it as WebMatrix site from here. Details about that example in this wiki page.

You can find the complete reference and details on the project wiki Usage page.

Screenshots

Archived files

Documentation

Source code

Package owner

João Acabado

João Acabado

João has 55 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
8.4.x (untested)
8.3.x (untested)
8.2.x (untested)
8.1.x (untested)
8.0.x (untested)
7.15.x (untested)
7.14.x (untested)
7.13.x (untested)
7.12.x (untested)
7.11.x (untested)
7.10.x (untested)
7.9.x (untested)
7.8.x (untested)
7.7.x (untested)
7.6.x (untested)
7.5.x (untested)
7.4.x (untested)
7.3.x (untested)
7.2.x (untested)
7.1.x (untested)
7.0.x (untested)
6.1.x (untested)
6.0.x (untested)

You must login before you can report on package compatibility.

Package Information

  • Package owner: João Acabado
  • Created: 01/02/2012
  • Current version 0.01a
  • License MIT
  • Downloads: 812