[Migrated] Search individual templates
Closed, DuplicatePublic

Description

It would be very useful to be able to restrict searches to individual templates. For example, suppose I'm using advanced search for cleaning up an https://en.wikipedia.org/wiki/IPA template, including reformatting stress and length marks <{{IPA|ˈ}}>, <{{IPA|ˌ}}>, <{{IPA|ː}}> for apostrophes, commas, and colons. Now, if the IPA template is embedded in an infobox, as it is with the planet infobox, or even if there are both an IPA template and an infobox on the same page, then every apostrophe, comma, and colon in the infobox will also be replaced and need to be deselected, making maintenance very time consuming. It would be nice to only replace things in the template I'm searching for. Kwamikagami 19:26, 1 July 2009 (UTC)

Reguyla added a project: AutoWikiBrowser.
Reguyla moved this task to Feature request (unsorted) on the AutoWikiBrowser board.
Reguyla added subscribers: Reguyla, Aklapper.

@Magioladitis 19:31, 1 July 2009 (UTC) wrote:
I think we can do with the Advanced find in replace. Create rules and subrules.

@Kwamikagami 23:31, 1 July 2009 (UTC) wrote:
I can't think of a way to do that, since the searches are global.

@ClickRick 23:37, 1 July 2009 (UTC) wrote:
Interestingly, I'm currently working on a plugin which will focus on doing things in specific places within templates, with a UI to help define the template, parameter and values which need attention. Might this be of interest?

@ClickRick 23:58, 1 July 2009 (UTC) wrote:
Screenshot at https://en.wikipedia.org/wiki/File:TheTemplator.png so you can get an idea of what I'm offering.

@Kwamikagami 08:53, 2 July 2009 (UTC) wrote:
Yes, that looks like it might do it. But it would still be nice to have a simple check box to restrict the find-replace to the template that matches the if/not conditions.

@Magioladitis 08:29, 2 July 2009 (UTC) wrote:
If I want to make changes in a specific template I am doing the following: Find and replace -> Advanced settings -> New Rule -> If contains -> Infobox Example and then I am creating subrules.

@Kwamikagami 08:53, 2 July 2009 (UTC) wrote:
But if the page contains a template that contains your search string, then the substitution will be made in ''all'' templates on the page, not just the one that contains the string. So if I change apostrophes, I mess up formatting in all of the info boxes.

@NE2 21:07, 6 July 2009 (UTC) wrote:
Try a regex like \{\{IPA\|([^\}]*)\ˈ([^\}]*)\}\} to {{IPA|$1[whatever you're replacing ˈ with]$2}}. I'm sure there are much more elegant ways.

@Kwamikagami 07:56, 7 September 2009 (UTC) wrote:
That works! Thanks. A feature option would still be nice, but with this I can at least take care of some of the more grievous problems.