3

I am using Sitecore 9.1

I recently deleted an item (let's call it A) and selected Link to another Item when presented with the Breaking Links dialog, redirecting these links to a new item (B). This means that items C and D now point to B instead of A. When I publish B and select publish related items, items C and D are not published... According to the Sitecore Documentation I have read, this seems to be because items that B links to are considered related, but not items that link to B. Is there a way to easily publish all the items that link to B or do I have to do this manually? (In my example there are only 2 items linking to B, but in fact, there are closer to 60, so publishing them manually is going to be hard.)

1
  • you can try publish related items as well in publishing dialog box. Commented Dec 10, 2021 at 13:07

2 Answers 2

4

You can use Sitecore Powershell Extensions to achieve what you need.

You first need to call Get-ItemReferrer function and then Publish-Item on every item you get from the first function.

$linkedItemId = "{00000000-0000-0000-0000-000000000001}"
$itemsLinkingToMyItem = Get-ItemReferrer -Path $linkedItemId

foreach ($itemLinkingToMyItem in $itemsLinkingToMyItem) {
    Publish-Item -Item $itemLinkingToMyItem
}

Source:

https://www.skillcore.net/sitecore/sitecore-publish-all-items-linking-to-an-item

0

Try to use the "Publish Item" with both "Republish" and "Publish related items" together if I understood you properly:

enter image description here

Also make sure, that C and D are in the Final workflow state and have no publishing restrictions and the link database is up-to-date.

As an alternative, you can use SPE script or the custom patches similar to: https://abarhoum.wordpress.com/2016/08/29/deep-publishing-of-related-items-with-sitecroe-experience-editor/

2

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.