0

I have a need to publish a page in Sitecore with all of the items referenced in its rendering's data sources.

The selectable options when publishing an item are the following:

  1. Publish Subitems - This will not publish data sources are linked globally (not under the current item). It will also publish everything if you want to publish the home page lets say.
  2. Publish Related Items - This will publish all the data sources but it also publishes the linked items. For some of our landing pages they may have thousands of links. We also in some cases do not want to publish those items.

Any ideas? I am surprised this is not a built-in option in Sitecore unless I am missing something.

1
  • Is programmatical publish appropriate for you? There is you can configure publish for your purposes Commented Nov 7, 2021 at 9:17

1 Answer 1

1

For now I have turned off the AddItemLinkReferences pipeline processor from the getItemReferences pipeline using the following patch file.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:x="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <pipelines>
            <getItemReferences>
                <processor type="Sitecore.Publishing.Pipelines.GetItemReferences.AddItemLinkReferences, Sitecore.Kernel">
                    <patch:delete />
                </processor>
            </getItemReferences>
        </pipelines>
    </sitecore>
</configuration>

Since I am using SXA, there is already a processor that runs to retrieve the rendering references so removing this one will only remove related items that are not linked via renderings.

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.