integreat-cms icon indicating copy to clipboard operation
integreat-cms copied to clipboard

Search and replace strings in all pages of a region

Open svenseeberg opened this issue 2 years ago • 1 comments

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.

svenseeberg avatar May 03 '22 12:05 svenseeberg

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).

svenseeberg avatar May 12 '22 13:05 svenseeberg

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

timobrembeck avatar Mar 16 '23 13:03 timobrembeck

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.

svenseeberg avatar Mar 18 '23 16:03 svenseeberg