Copied to clipboard

Flag this post as spam?

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


  • Rajesh 7 posts 27 karma points
    Nov 24, 2011 @ 11:56
    Rajesh
    0

    How to retain content using courier deployment

    I have one page let's say "Benefit" having two fields, one is Description (textstring) and other one is selectpictures (Media). i have entered some text in description and select picture in the second one.

    After doing courier, i dont want description field to be updated, but only wants images fields to be updated on target website.

    In berif want some of field to be updated and few fields retains thier contents.

     

     

  • Per Ploug 865 posts 3491 karma points MVP admin
    Nov 29, 2011 @ 11:05
    Per Ploug
    0

    You will have to hook into the api, using a DataResolver, which can intercept the data, and remove property data from the collection before saving, that will avoid it from being updated.

    The class handling property data is called ContentPropertyData

    Docs are here: http://nightly.umbraco.org/UmbracoCourier/Data%20Resolvers.pdf

  • Rajesh 7 posts 27 karma points
    Nov 29, 2011 @ 12:41
    Rajesh
    0

    Thanks Per Ploug,

    But i have one more query that where to write this code, as i want to retain content for all content properties.

    //here we intercept the actual data and replace any unicorn mention with "horse"
    public override void PackagingProperty(Core.Item item, ItemProviders.ContentProperty propertyData)
    {
    //get the refence to the property data object the data is part of
    var properties = (ContentPropertyData)item;
    if (propertyData.Value.ToString() == "unicorn")
    propertyData.Value = "Horse";
    }

    So could you please suggest in which file i have to write this code.

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft