Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cmdlet to change links from one item to another and remove all links to an item #717

Closed
AlexKasaku opened this issue Oct 13, 2016 · 3 comments
Assignees
Labels
🤩-release-highlight Exciting change that should be highlighted in the release notes and celebrated by SPE fans. area-commands Involves functions and cmdlets. 🌈 improvement Extra sugar and spice.
Milestone

Comments

@AlexKasaku
Copy link
Contributor

AlexKasaku commented Oct 13, 2016

Sitecore has a Relink dialog that appears when you delete an item, allowing you to change all links to an item to another item.

This would be handy to have as a cmdlet that allows you to just do this easily, e.g.

Update-ItemReferrer [-Item] <Item> -NewTarget <Item>
Update-ItemReferrer -NewTarget <Item> -Path <string> [-Language <string[]>]
Update-ItemReferrer -NewTarget <Item> -Id <string> [-Database <string>] [-Language <string[]>]

This would find all references to $oldItem and replace these with $newItem .

Removing references could be done too:

Update-ItemReferrer [-Item] <Item> -RemoveLink
Update-ItemReferrer -RemoveLink -Path <string> [-Language <string[]>]
Update-ItemReferrer -RemoveLink -Id <string> [-Database <string>] [-Language <string[]>]
@AlexKasaku
Copy link
Contributor Author

@AdamNaj AdamNaj changed the title Cmdlet to relink one item to another Cmdlets to relink one item to another and remove link Oct 13, 2016
@AdamNaj AdamNaj changed the title Cmdlets to relink one item to another and remove link Cmdlets to relink one item to another and remove all links to an item Oct 13, 2016
@AdamNaj AdamNaj changed the title Cmdlets to relink one item to another and remove all links to an item Add Cmdlet to change all links from one item to another and remove all links to an item Oct 13, 2016
AdamNaj added a commit that referenced this issue Oct 13, 2016
@AdamNaj AdamNaj added 🌈 improvement Extra sugar and spice. area-commands Involves functions and cmdlets. labels Oct 14, 2016
@AdamNaj AdamNaj added this to the 4.2 milestone Oct 14, 2016
@AdamNaj AdamNaj self-assigned this Oct 14, 2016
@AdamNaj
Copy link
Member

AdamNaj commented Oct 14, 2016

Advanced relinking samples
https://gist.github.com/AdamNaj/354660183bea96a4ceb06cf1a9a92f30

@AdamNaj AdamNaj changed the title Add Cmdlet to change all links from one item to another and remove all links to an item Add Cmdlet to change links from one item to another and remove all links to an item Oct 15, 2016
@AdamNaj
Copy link
Member

AdamNaj commented Oct 15, 2016

Implemented

@AdamNaj AdamNaj closed this as completed Oct 15, 2016
@AdamNaj AdamNaj added the 🤩-release-highlight Exciting change that should be highlighted in the release notes and celebrated by SPE fans. label Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤩-release-highlight Exciting change that should be highlighted in the release notes and celebrated by SPE fans. area-commands Involves functions and cmdlets. 🌈 improvement Extra sugar and spice.
Projects
None yet
Development

No branches or pull requests

2 participants