Page MenuHomePhabricator

TemplateSandbox should support /sandbox subpages
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do):
TemplateSandbox should be able to show a page with a specific template replaced with a subpage of that template.

Steps to reproduce (a list of clear steps to create the situation that made you report this, including full links if applicable):

  • An editor makes changes to Template:Foo/sandbox
  • The editor opens an edit request to implement those changes or wants to discuss them to gain consensus for the changes
  • I want to be able to easily see how the proposed changes look "in real life", with other content on the page and parameters filled in
    • I want to be able to link this page to others

Use case(s) (describe the actual underlying problem which you want to solve, and not only a solution):
On many wikis, template changes are typically developed and proposed using a /sandbox subtemplate (such as Template:Not a sandbox/sandbox). This allows for more collaboration between editors than userspace sandboxes, makes upcoming changes more visible, and retains edit history for attribution when multiple editors are involved. Template sandbox subpages are also used with testcases subpages (like Template:Documentation/testcases) to make sure template changes work as expected and don't introduce regressions.

When requests to change templates based on a sandbox are made, there is no easy way to see what those changes look like on other pages. The only ways to do this now are to manually change {{Foo}} to {{Foo/sandbox}} (which doesn't work well when a template is used in another template, or is used many times on a page) or to copy-paste the sandbox to the main template and use the existing TemplateSandbox preview.

Event Timeline

The ability is already available at the backend layer, both via the TemplateSandbox API as well as from normal webrequests. This can be invoked from scripts, eg. https://en.wikipedia.org/wiki/User:Jackmcbarn/advancedtemplatesandbox.js.

So this is more of a question about how to expose the option from the UI.