Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • higgsy 65 posts 92 karma points
    Sep 29, 2012 @ 18:36
    higgsy
    0

    Getting DAMP Datatype settings in Razor!

    Hi,

    I've got a funny one! I've got two DAMP data types:

    • Large Image Picker
    • Small Image Picker
    The crop name is different in each, obviously coresponding to a large and small crop. On some document type I use the small data type, on other I use the large one, however the property always has the same name. This way I can reference it in a single macro (razor).
    The problem is that my macro doesnt know whether the user has selected a large image or a small image, so I cannot effectively use DAMP_Helper.GetImageCropperUrl because tis method requires the name of the crop.
    Is there of way of getting the settings of the data type which in turn would give me access to the name of the crop which was defined when setting up the small/large data types? OR am I looking at this the wrong way - is there a different way this can be acheived? I could only think of adding the name of the crop to the document type, but this seems like an awful hack.
    Thanks in advance - sorry to post on a saturday!!
    Al

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Oct 01, 2012 @ 10:37
    Jeroen Breuer
    0

    Hello,

    I assume that if you place the macro on a template you know there what crop you want do display? In that case you could add an extra parameter to the macro (more info here and here) and pass that parameter to the DAMP helper. Also see this topic: http://our.umbraco.org/forum/developers/razor/19984-Razor-variable-property.

    Jeroen

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Oct 01, 2012 @ 10:37
    Jeroen Breuer
    0

    Remove double post.

Please Sign in or register to post replies

Write your reply to:

Draft