Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Is it possible to exclude particular content from the sync?
We have a shop section where the products are synchronised from another system, so synching them through converge is not required, would be handy to have some kind of exclusion list.
Hi Huw, there is a way to set the default action for certain content, in this case you can automatically set it to Ignore. Take a look at the "Default Action Setter" section in the documentation.
I can immediately see that this is quite limiting as you only have the name to go on. I will take a look at including the path in the GetDefaultAction() function.
Another approach could be to set up specific users on both the remote and local sites and use Umbraco permissions to stop access to the shop section. Then use those users when using Converge.
Thanks for the pointer, I will take a look at creating an action setter for my products.
I gave it a try, but don't see how I can get it to ignore all the products
Basically I have a Shop page that has children who are 'product' (doc type alias) created as below
_contentService.Create(productname, shopId, "product");
I want to ignore all these 'product' when synching, can't see how I do that using the defaultactionsetter interface,
I realised earlier that just having the name would be limiting. Currently working on adding the path to that function, that will allow you to identify the position in the content tree.
The only other solution I can think of is to use the ContentService within the DefaultActionSetter to check if it is a "product". Something like (untested):
var productContentType = Umbraco.Core.Composing.Current.Services.ContentTypeService.Get("product");
if (productContentType != null)
var productContent = Umbraco.Core.Composing.Current.Services.ContentService.GetPagedOfType(productContentType.Id, 0, int.MaxValue, out numRecords, null).FirstOrDefault(c => c.Name == itemName);
if (productContent != null)
action = MergeAction.Ignore;
Not sure how you set up the "filter" parameter, but that may help. You could pre-load products into a List<string> if speed is an issue.
That would only work if the product exists locally.
Thanks for info, I will try that, theproducts do exist in both local and remote, I just don't want to synch incase the prod version has had any properties updated (description/image etc, but they should at least exist in both systems.
worked a treat, thanks for the help.
I notice that in your latest version you added a path parameter to the GetDefaultaction on Action setters, could you perhaps provide a quick example of that works?
Your code is a godsend by the way :)
Glad it's proving useful Huw.
I added the path parameter to provide a bit extra information. You can ignore it if you don't need it. It is a "\"-separated list of this item's ancestors. Each name in the list is URL-encoded and can be decoded using HttpUtility.UrlDecode().
For example, this will ignore all the local-only nodes under "\Home\Ignore Local Folder":
if (contentType == ConvergeContentType.Content)
var parents = path.Split('\\');
if (parents.Length > 2 && status == CompareStatus.LocalNotRemote)
// path starts with "\", so ignore parents - it is blank
if (HttpUtility.UrlDecode(parents) == "Home" && HttpUtility.UrlDecode(parents) == "Ignore Local Folder")
mergeAction = MergeAction.Ignore;
The actual path string provided will look like this (as the components are Url-encoded): "\Home\Ignore+Local+Folder"
Many thanks for the explanation.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted