Copied to clipboard

Flag this post as spam?

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


  • z4kk 24 posts 83 karma points
    Feb 21, 2013 @ 22:31
    z4kk
    0

    Default Values for Media Type

    Hi!

    Need some help.

    How I can set default value for media type field. For example:

    I need create media type SomeMediaType with property ZoomFactor: 1

    And media type AnotherMediaType with property ZoomFactor: 4

    This property must be constant for this media type, and be available after first save.

     

    Thanks!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 21, 2013 @ 23:21
    Jan Skovgaard
    0

    Hi z4k

    If you have 2 different media types would that then not be enough to determine the zoom-factor? Could you perhaps describe the use case a bit more detailed? Currently there is no way of setting default values on media out of the box. That will require some interaction with the API.

    That way you can hook into an event when one of the media types are created and then populate it with the desired value for the default zoom level.

    You can see a list of events here http://our.umbraco.org/documentation/Reference/Events/Document-Events (valid for v4)

    And here you can read some more about using the API to manipulate media http://our.umbraco.org/documentation/Reference/Management/Media/

    Hope this helps.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft