Page MenuHomePhabricator

Add substitute button
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):
Add a substitute button to editing toolbar that would substitute all {{subst:templates}} to the editor. This can be acomplished via a pre-save transform (i.e. the button replaces the content in editor with what would it be after saving, without saving the page).

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
E.g. a wiki have a template T1 which is only a wrapper of another template T2. So you can have {{subst:T1|xxx}} which will become a call of T2. This task proposes a button that turns {{subst:T1|xxx}} to calls of T2 without clicking save.

Benefits (why should this be implemented?):
It would make it easier to edit and see what will be substituted

Event Timeline

What does "would substitute all {{subst:templates}} to the editor" mean exactly?
Could you please provide an example?

What does "edit something in the result" mean?

Let's say we have a template {{Hello}} with content "Hello {{{1}}}!".
Then I'm making a page and I write the following:

{{subst:Hello|hdicu}}

Then if I click the button, it would change the text I wrote to:

Hello hdicu!

For example if I wanted to change Hello to Hi without the button, I'd have to either copy contents of Hello template to the editor and replace {{{params}}} with right values or save the page in order to change it.

Aklapper changed the task status from Open to Stalled.Oct 4 2025, 12:03 PM

Then if I click the button, it would change the text I wrote to:

There is already a "Show Preview" button. Why is yet another button needed?

For example if I wanted to change Hello to Hi without the button, I'd have to either copy contents of Hello template to the editor and replace {{{params}}} with right values or save the page in order to change it.

I don't see why MediaWiki should support editing content of some Template page within a completely different page.

There is already a "Show Preview" button. Why is yet another button needed?

The button would do the change the wikitext to what it is after saving.

I don't see why MediaWiki should support editing content of some Template page within a completely different page.

I didn't mean that it would change the template itself. I meant that if you want to substitute a template and make a small change to the substituted content.

The button would do the change the wikitext to what it is after saving.

Isn't that what the Preview function in more modern editors, like VisualEditor, would be for?

Bugreporter changed the task status from Stalled to Open.Oct 6 2025, 4:03 PM
Bugreporter updated the task description. (Show Details)