Community Wishlist Survey 2023/Editing/"Preview page with this template" should only accept/suggest pages that transclude the template
Appearance
"Preview page with this template" should only accept/suggest pages that transclude the template
- Problem: I've used the "Preview page with this template" many times and wondered why my changes weren't being applied, only to realize e.g. I was editing the sandbox and the page was using the live version.
- Proposed solution: If the specified page does not transclude the template, the server will return an error instead of the unaltered version of the page. Similarly, the autocomplete feature of the textbox only suggests pages that transclude the template.
- Who would benefit: Template editors
- More comments: The autocomplete improvement is difficult with the currently available APIs, except in extremely inefficient ways (see T279736#7142483).
- Phabricator tickets: T279736
- Proposer: Nardog (talk) 13:35, 28 January 2023 (UTC)
Discussion
- Somewhat related: Community Wishlist Survey 2023/Editing/Create a private sandbox page for a Wikipedia user: create a private sandbox that would replace the "Preview page with this template" feature. Taylor 49 (talk) 10:18, 5 February 2023 (UTC)
- I respectfully disagree and believe that to be entirely different. Creating a page and editing a page are two different things. The only thing in common is the sandbox, so they're only in the same category so to speak, but not similar. Magnoliasouth (talk) 22:56, 10 February 2023 (UTC)
- It would be better if it asked if you want to replace the template with the sandbox version, when you preview the sandbox (template/sandbox) on an article which includes the production template. MarMi wiki (talk) 20:18, 10 February 2023 (UTC)
- A more generic solution is to preview a page using the current page instead of some template, e.g. preview Article with Template:T/sandbox (which I'm editing) in place of Template:T. User:Jackmcbarn/advancedtemplatesandbox.js achieves this on enwp, and I find it very useful. Certes (talk) 21:12, 10 February 2023 (UTC)
- @MarMi wiki and Certes: I don't think you've understood the problem. The sandbox vs live thing is just an example. The problem is that the server returns the unaltered version of the page before checking if it transcludes the template in the first place. Nardog (talk) 22:51, 10 February 2023 (UTC)
- Either solution would work for the sandbox example. There are places where your proposal would work but mine wouldn't, and vice versa. I'd support them both. Certes (talk) 23:07, 10 February 2023 (UTC)
- So you want the server to constantly monitor and filter out the pages? This could be more resource consuming than sending entire page and checking it on demand. Or not. MarMi wiki (talk) 00:01, 11 February 2023 (UTC)
- No, the server can check if the page transcludes the template only after the form is submitted, then output an error instead of the unaltered version. Nardog (talk) 00:09, 11 February 2023 (UTC)
- @MarMi wiki and Certes: I don't think you've understood the problem. The sandbox vs live thing is just an example. The problem is that the server returns the unaltered version of the page before checking if it transcludes the template in the first place. Nardog (talk) 22:51, 10 February 2023 (UTC)
Voting
- Support --Ciencia Al Poder (talk) 18:37, 10 February 2023 (UTC)
- Support Support a generic solution as discussed above. Certes (talk) 21:12, 10 February 2023 (UTC)
- Support Magnoliasouth (talk) 22:53, 10 February 2023 (UTC)
- Support --NGC 54 (talk|contribs) 00:47, 11 February 2023 (UTC)
- Support * Pppery * it has begun 03:50, 11 February 2023 (UTC)
- Support SD0001 (talk) 10:17, 11 February 2023 (UTC)
- Support Rots61 (talk) 16:11, 11 February 2023 (UTC)
- Support Sandbox previewing should be like transcluding the main template. Thingofme (talk) 16:13, 11 February 2023 (UTC)
- Support Izno (talk) 07:29, 13 February 2023 (UTC)
- Support cyrfaw (talk) 12:10, 15 February 2023 (UTC)
- Support Matma Rex (talk) 22:10, 15 February 2023 (UTC)
- Support And ideally clip/truncate the preview to the section(s) that actually contain the template. Kays (talk) 02:23, 17 February 2023 (UTC)
- Support Hans5958 (talk) 02:59, 20 February 2023 (UTC)
- Support Althair (talk) 04:01, 23 February 2023 (UTC)
- Support Wargo (talk) 22:11, 23 February 2023 (UTC)