20 votes

DAMP Property Editor Value Converter

With this package it's easier to use DAMP in RazorIt can work with the xml or id's that DAMP saves. If you do Model.propertyName it will return a list you can loop through.  It also has the following properties:

IsXml - Returns a boolean if the data is stored as xml.
PropertyData - Returns a string with the raw data.
First - Returns the first item from the list.
Count - Returns how many media items are selected.
Any - Returns a boolean to see if any items are selected.
Xml - Returns all media items as DynamicXml.
Skip(int) - Used for paging.
Take(int) - Used for paging.

Each object in the list has the following properties: 

Id - Returns the id of the media item.
Name - Returns the name of the media item.
Type - Returns the Media Type of the media item.
File - Returns the url of the media item if it exists.
Url - Also returns the url of the media item if it exists.
Alt - Returns the alt property. If it doesn't exist it will return the name.
Resized - Returns the resized property if it exists.
Xml - Returns the current media item as DynamicXml.
Children - Returns the children of this media item as a list.
Crops - Returns a DynamicDictionary with all the crops.
TypedCrops - Returns the crops as a Dictionary<string, string>.

Different versions

There are 2 versions of this package. The first version is called the DAMP Razor Model and works on Umbraco 4.7.1.1 and higher with the old Razor: http://bit.ly/SV0jc6

The second version is called the DAMP Property Editor Value Converter and works on Umbraco 4.10 and higher with the new Razor: http://bit.ly/VTMAFC

You already need DAMP installed: http://bit.ly/ijPtF9 

Example packages

The example packages will probably only work on Umbraco 4 and not 6. They're still a nice demonstration so you can try them on v4.

If you want some old Razor (4.7) examples you can install the DAMP Razor Model Samples package: http://bit.ly/RWsdBr

If you want some new Razor (4.10) examples you can insall the DAMP Property Editor Value Converter Samples package: http://bit.ly/VTMpKh

Videos

Here is a quick video on how to use the DAMP Razor Model: http://www.screenr.com/qvj8

Here is a quick video on how to use the DAMP Property Editor Value Converter: http://www.screenr.com/g2H7

Forum

If you have any questions about this package you can ask them here: http://bit.ly/RWdVBh

Screenshots

Package owner

Jeroen Breuer

Jeroen Breuer

Jeroen has 12121 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.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 (100%)
6.0.x (untested)

You must login before you can report on package compatibility.

Package Information

  • Package owner: Jeroen Breuer
  • Created: 24/10/2012
  • Current version 1.2
  • License MIT
  • Downloads: 6610