digitalfabrik / integreat-cms

Simplified content management back end for the Integreat App - a multilingual information platform for newcomers
https://digitalfabrik.github.io/integreat-cms/
Apache License 2.0
55 stars 33 forks source link

Search and replace strings in all pages of a region #1382

Open svenseeberg opened 2 years ago

svenseeberg commented 2 years ago

Motivation

Lots of content is duplicated in many pages, for example 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.

Maybe this function should only touch text elements, not target addresses of links etc. This will be implemented with #1851.

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. (We may want to use a linkchecker based solution for that.)

timobrembeck commented 1 year ago

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

svenseeberg commented 1 year ago

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.