2

Is there any way to configure the level of Deep publish in the Auto Publish workflow command?

enter image description here

Currently Its support the Boolean value: true or false(using value deep=1 or deep=0) to check whether the publish item includes the children or not?

My requirement is to configure the Deep level of publish Item using this deep parameter for example if I set the value "deep=5", it should publish the children items up to the level 5,

Just wondering, Is there any sitecore out of the box functionality available ? or should I override the Publish Action class behavior to handle the deep parameter value - "Sitecore.Workflows.Simple.PublishAction, Sitecore.Kernel".

Please suggest or share the link or module if somebody already did this.

4
  • Deep is either true or false, and I suspect you need to tap into publish pipelines or events to get this to work (or build a "collection of items" in the save action). I prefer not to use Workflow for publishing items - every single approval will in effect clear your HTML cache thus affecting performance, keep this in mind.
    – jammykam
    Commented Nov 28, 2017 at 5:04
  • 1
    While there are scenarios where workflow publishing is fine, setting a 'level' on publishing would scare me. Your authors would have no idea why some of the items published and some did not. If it happened to be nested too far down because the author was using subfolders or something to group their datasources, how would you handle that? Instead, the item approved should only publish the items that were approved (i.e. true related items that are referenced). Using depth leads to UX issues. Commented Nov 28, 2017 at 13:53
  • @jammykam you are correct, I also proposed some schedule publishing solution.. Thanks Man.. but Just wanted to check if somebody did the same customization(Deep level collection). Commented Dec 2, 2017 at 6:27
  • @JayS correct, It could be really costly if deep level would really be deeper, In case of branch template and local datasource folder, all the child is getting published with the main item if deep=1. Commented Dec 2, 2017 at 7:11

1 Answer 1

7

deep parameter supports just two values: "1" and "other value".

You need to override PublishAction to handle deep publishing on multiple levels.

Publish action accepts 6 parameters:

"deep" - controls whether children of the current item will be published. Possible values: "1" - children of the current item will be published; all other values - children of the current item will not be published.

"related" - controls whether related items of the current item will be published. Possible values: "1" - related items of the current item will be published; all other values - related items of the current item will not be published.

"targets" - comma (,) separated list of database names that item will be published to. Note, that this parameter does not expect a list of publishing target names, it expects list of database names.

"alllanguages" - controls whether current item will be published in all languages that exist in source database. Possible values: "1" - current item will be published in all languages that exist in source database; all other values - code uses values of other parameters to determine languages in which current item will be published.

"languages" - comma (,) separated list of languages in which current item will be published. "itemlanguage" - controls whether current item will be published in its current language.

Possible values:

"1" - current item will be published in its current language; "0" - current item will not be published in its current language;

all other values - current item will published in its current language. Note that even if value of this parameter is "0", current item will still be published in its current language if current language of the item is in "languages" list.

https://community.sitecore.net/technical_blogs/b/latest_technical_reinnovations/posts/auto-publish-workflow-action-updates

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.