29

When you publish an item in Sitecore through the Publish item dialog, you are offered several options. You can choose between Smart publish or Republish, you can also choose whether to Publish subitems or not.

These options are pretty self-explanatory.

However, what exactly does the Publish related items option do?

Publish related items

41

Technical details

Starting from Sitecore 7.2, there is an option to publish an item with "Publish related items" checked. If you do that, the <getItemReferences> pipeline (defined in Sitecore.config) will be executed to get additional items that are then added to the publishing queue. By default, it returns the following items related to the item being published:

  • The item's clones (by the AddItemCloneReferences processor);
  • The media used by the item (by processors AddFileDropAreaMediaReferences and AddItemLinkReferences);
  • All items the published item links to (by the AddItemLinkReferences processor).
  • The item's aliases (by the AddItemAliasReferences processor).

If you wish, you can extend this pipeline by adding your custom "related items" logic as a new processor.

Link database

The link database needs to be up-to-date in order for this feature to work correctly. So if you have problems with publishing related items, try to rebuild the links DB.

Items specified as the data source of a rendering component will also be treated as "related". This is possible because they are also stored in the link database (at least, in the latest versions of Sitecore). Keep in mind that the link database will only contain data source items that are specified directly (e.g. using a path or an item ID). Query-based data sources will not update the link database, and hence, such items will not be published using "Publish related items".

Feature usage

As an example, this feature may be useful when you are publishing a new page, and you want to make sure that all resources used by that page are also published.

Publishing related items is only available during an item-level publish, and not during a site-level publish.

Important caveat

  • Related items of related items will not be published. This may cause some confusion—see this question for an example.
  • When you publish both the subitems and the related items, then all related items of all subitems will also be published. This may significantly increase the amount of items added to the publishing queue, so be mindful of this behavior.

Further reading

  • 3
    How about items references from renderings, for example a rendering datasource? Do they get published as "related items"? – Phil Burton Oct 20 '16 at 10:52
  • As far as I know, in Sitecore 8, data source items will also be present in the links database, and hence will be published. I will verify if this is true later today. – Dmytro Shevchenko Oct 20 '16 at 11:05
  • @PhilBurton I checked and rendering definition items and rendering datasources will be published using this feature (with some caveats). I have updated my answer. – Dmytro Shevchenko Oct 20 '16 at 16:37
  • This is a great answer and just confirms some hell we were going through. We had content the client was working on as a draft on the CM and when they worked on other content and published, that content was published as well (because it was linked from the item being published). For now, we have advised them not to publish with related items until we can override that behavior. – tjans Jul 14 '17 at 19:54
7

Publish related items will do what it says: it will add the "related" items to the list of items the need to be published. Related means can be:

  • Clone references – items that are clones of the selected item.
  • Media references – media items that are related to the selected item.
  • Alias references – items that are aliases of the selected item.

It will publish items related to your "current item" through datasources, links and so on. Remember though that only the actual linked item is published (sometimes people expect the children of the datasource to be published as well).

https://doc.sitecore.net/sitecore_experience_platform/content_authoring/publishing/publish_an_item_to_your_website

It was introduced because editors "forgot" to publish the content they had created/updated related to the item/page they were on.

5

Publish Related Items are:

Clone references – items that are clones of the selected item.

Media references – media items that are related to the selected item.

Alias references – items that are aliases of the selected item.

This is lifted from the Sitecore Doc site its near the end. Here is the link Publish an item to your website

Hope this helps.

1

What I would add to this conversation is that publishing with related items can snowball easily to a few hundred items from even a single item which is why I use this option in very select moments and usually not while publishing more than one item and the same time if it can be helped.

I find that "smart publishing" in the long run takes less time where publishing is concerned and it is designed to pick up unpublished items which should take care of any "related items" which has been missed.

0

starting Sitecore 9.0 there is a feature named deepscan publishing, which by default is enabled and publishes the the related items of related items of related items (yes repeatedly gets the references of each of the reference). Checkout the getItemReferences pipeline > AddItemLinkReferences processor, you see an option Deepscan and its usage to get the ferences when true. Beware of the publishing times with Deepscan enabled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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