integreat-cms
integreat-cms copied to clipboard
Search and replace strings in all pages of a region
Motivation
Lots of content is duplicated in many pages, for example links, telephone numbers, e-mail addresses, etc. If this information changes, editors need to check all pages and update the information there. A centralized search & replace function can speed this process up.
Proposed Solution
Implement a search and replace function across all pages. This should generate a new version of the page. The user should be able to choose if the change is a minor or normal change and if the replacement should be done in all or one specific language.
Alternatives
Manually do this.
Additional Context
This function can be called after cloning a region to replace the base URL + region slug with the new region name.
Fixing this issue should include an easy to use function to replace a broken link that was found in multiple pages (see https://github.com/digitalfabrik/integreat-cms/issues/1405).
Are there any use cases for this function besides links? tel and mailto links can also be covered by the link checker and are just disabled currently: https://github.com/digitalfabrik/integreat-cms/blob/4ff1d4433c871763ab2f5d235afe5c0d3928e496/integreat_cms/core/settings.py#L922-L926
If we don't need a generic string search & replace, this would probably make things a bit easier.
Just the link text replacement is a bit tricky, but at least the Link model keeps track of the link texts as well: https://github.com/DjangoAdminHackers/django-linkcheck/blob/13674512f52a38471f56f887230ed689616edf5a/linkcheck/models.py#L483-L496
Yes, there would be some use cases. However, they're not extremely important. One possible application would be updated names of offices. I'm not aware of any existing problem right now that is waiting for this feature. That means we could move it to the backlog for the time being.