Copied to clipboard

Flag this post as spam?

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


  • John Bergman 424 posts 976 karma points
    Jan 30, 2019 @ 18:24
    John Bergman
    0

    USync Content - protecting specific nodes

    Question: I'd like to protected a few nodes from being overwritten by usync in one of our implementations.

    Has any thought been giving to adding a "magical" property called something like "usyncIgnore" or "usyncReadonly"? That way the code that imports could just skip it if the property is set?

    Otherwise what's the impact to adding an event handler that prevents the node from being saved, How would I best do that without impacting the rest of the usync import process (i'd prefer not to have a redbar error message)?

  • Kevin Jump 1434 posts 9178 karma points MVP 3x c-trib
    Jan 30, 2019 @ 19:18
    Kevin Jump
    101

    Hi

    Good news - there are some secret settings to stop nodes being overridden :)

    on the content handler, you can add extra settings: https://usync.readthedocs.io/handler-config/#custom-handler-actions

    the one you are looking for is ignore where you can put the path to the content you don't want to overwrite.

    <HandlerConfig Name="uSync: ContentHandler" Enabled="true">
      <Setting Key="ignore" Value="home\blog\example" />
    </HandlerConfig>
    

    You can comma separate so, for example, home\blog,home\shop would skip both blog and shop.

    -

    The only other extra thing is that sometimes you might still want the content writing out to disk, but not importing into your target site - for this, you can set the rulesonexport setting to false - then the rules won't count on export/save so everything is still on disk, even if it doesn't go back into your target site.

  • John Bergman 424 posts 976 karma points
    Feb 02, 2019 @ 22:36
    John Bergman
    0

    Hey Kevin, quick question... is the list case sensitive? How does the umbraco properties (like umbracoNaviHide and umbracoUrlName) play into this?

    If my path is:

    enter image description here

  • Kevin Jump 1434 posts 9178 karma points MVP 3x c-trib
    Feb 02, 2019 @ 22:46
    Kevin Jump
    0

    Hi,

    It's the path as usync would write it to disk, which uses the Umbraco function ToSafeFileName.

    I think in your case that would probably be SiteConfiguration/SiteSettings.

    Content properties have no effect it's all based on the path.

    Kevin

  • John Bergman 424 posts 976 karma points
    May 17, 2019 @ 06:22
    John Bergman
    0

    Hey Kevin, just another quick question, does it ignore all the child nodes? So in the example above if I used SiteConfiguration, would it also ignore the 3 nodes below it? The documentation isn't clear about that.

  • Kevin Jump 1434 posts 9178 karma points MVP 3x c-trib
    May 17, 2019 @ 08:42
    Kevin Jump
    0

    Yeah it should ignore anything starting with that path.

    K

Please Sign in or register to post replies

Write your reply to:

Draft