Support "substituting" templates in transclusion dialog
OpenPublic

Description

User:JohnCD at English Wikipedia writes the following:
"If you enter, for instance, "Welcome" in the new template box, on clicking "Apply changes" you see the result; but if you enter "subst:welcome" you see only {{subst:welcome}}, though after clicking "Save page" the result is correct. Should there be a check-box for "subst" in the New template dialogue, (a) to save typing it out, (b) to arrange the correct display?"

James F. suggested this would be good to enter as an enhancement request, since template substitution should be supported.

Maggie


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=66281

bzimport set Reference to bz49904.
Mdennis-WMF created this task.Via LegacyJun 20 2013, 7:30 PM
SalixAlba added a comment.Via ConduitAug 30 2013, 1:59 PM

Lots of important templates need subst. On en {{prod}} and {{afd}} both need to be subst.

Thryduulf added a comment.Via ConduitAug 30 2013, 9:17 PM

This is effectively a subset of bug 49833 which seems to be part tracking, part bugs, part enhancement requests

Jdforrester-WMF added a comment.Via ConduitAug 30 2013, 9:59 PM

(In reply to comment #2)

This is effectively a subset of bug 49833 which seems to be part tracking,
part bugs, part enhancement requests

… part mess. :-(

Not sure why you turned it into a tracker after Krinkle mis-named it; I don't think it helps at all. I might undo that.

Thryduulf added a comment.Via ConduitAug 31 2013, 12:20 AM

(In reply to comment #3)

(In reply to comment #2)
> This is effectively a subset of bug 49833 which seems to be part tracking,
> part bugs, part enhancement requests

… part mess. :-(

Not sure why you turned it into a tracker after Krinkle mis-named it; I don't
think it helps at all. I might undo that.

Sorry, that would be my misunderstanding of Krinke's intentions and then trying to be helpful. :(

Jdforrester-WMF added a comment.Via ConduitSep 3 2013, 4:56 PM

(In reply to comment #4)

(In reply to comment #3)
> (In reply to comment #2)
> > This is effectively a subset of bug 49833 which seems to be part tracking,
> > part bugs, part enhancement requests
>
> … part mess. :-(
>
> Not sure why you turned it into a tracker after Krinkle mis-named it; I don't
> think it helps at all. I might undo that.

Sorry, that would be my misunderstanding of Krinke's intentions and then
trying to be helpful. :(

Not your fault at all. :-) All fixed now, anyway.

Jdforrester-WMF added a comment.Via ConduitJan 17 2014, 4:00 AM
  • Bug 59182 has been marked as a duplicate of this bug. ***
Sunpriat added a comment.Via ConduitJul 30 2014, 10:34 AM

Not only in insert dialogue. Template text should be inserted and rerendered page immediately.
for example:
-[[:en:Template:Accent]]
-[[:ru:Шаблон:Ударение]]

i do
-te|xt
-insert/template - subst:Ударение

i see in VE
-te{{subst:Ударение}}xt
(after saving the page text in read mode looks normally: téxt)

I want to see in VE
-téxt

if possible it should be a new method "template (with parameters) to text ()" with no return to template
for example:
-"insert/subst" or "insert/template" and in dialogue check-box for "subst"
-open TemplateData for "template" (now for "subst:template" TemplateData not shown)
-press Add template
-template is executed and generate new text which is inserted same as ctrl+v
-the new text (or all page) rendered (may consist any other template inside it)

Whatamidoing-WMF added a comment.Via ConduitAug 9 2014, 11:22 PM

Subst:ing isn't working (again? still?).

If you follow the (soon-to-be-blanked) directions in the user guide, you get the text typed in, with no display, no expansion, and no processing. The result is that the exact wikitext of your template displays on the page, exactly as if it had been nowiki'd, but without the nowiki tags.

https://en.wikipedia.org/w/index.php?diff=620566012&oldid=618729009

gerritbot added a comment.Via ConduitAug 13 2014, 9:01 PM

Change 153895 had a related patch set uploaded by Alex Monk:
Add a subst property to template data which adds "subst:" to the target

https://gerrit.wikimedia.org/r/153895

gerritbot added a comment.Via ConduitAug 13 2014, 9:07 PM

Change 153934 had a related patch set uploaded by Alex Monk:
Provide a checkbox on template page of transclusion dialog to substitute when saving

https://gerrit.wikimedia.org/r/153934

gerritbot added a comment.Via ConduitOct 7 2014, 10:42 PM

Change 153895 abandoned by Alex Monk:
Add a subst property to template data which adds "subst:" to the target

Reason:
I'm not actually planning to work on this commit. The associated VE commit will continue to depend on this however.

https://gerrit.wikimedia.org/r/153895

Jdforrester-WMF moved this task to TR9: ???? on the VisualEditor workboard.Via WebNov 23 2014, 11:00 PM
Jdforrester-WMF changed the title from "VisualEditor: Support "substituting" templates in transclusion dialog" to "Support "substituting" templates in transclusion dialog".Via WebNov 24 2014, 1:47 AM
Jdforrester-WMF assigned this task to Krenair.
Jdforrester-WMF lowered the priority of this task from "Normal" to "Low".
Jdforrester-WMF moved this task to TR5: ???? on the VisualEditor workboard.
Jdforrester-WMF set Security to None.
Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebJan 15 2015, 12:10 AM
Krenair placed this task up for grabs.Via WebApr 2 2015, 3:33 AM
Krenair edited projects, added Parsoid; removed Patch-For-Review.
marcoil added a subscriber: marcoil.Via WebApr 2 2015, 7:47 AM
Trizek-WMF added a subscriber: Trizek-WMF.Via WebJun 22 2015, 3:17 PM
Krenair added a comment.Via WebJun 26 2015, 10:45 PM

I'm not sure the parsoid API from T73161 is quite what we were looking for. The idea had been to allow the user to mark a template to be substituted upon save, but with this we'd have to substitute an entire transclusion (immediately?)

ssastry added a subscriber: ssastry.Via WebJun 26 2015, 10:53 PM

I'm not sure the parsoid API from T73161 is quite what we were looking for. The idea had been to allow the user to mark a template to be substituted upon save, but with this we'd have to substitute an entire transclusion (immediately?)

But, whenever a user edits a transclusion, you are querying the API to fetch the expansion. So, you would enable the subst parameter alongwith the query instead of marking up individual transclusions for 'at-save' substitution. Once substed, the transclusion itself goes away and the editor can further tweak that output if required.

ssastry added a comment.Via WebJun 26 2015, 10:57 PM

But yes, you would have to substitute transclusions immediately, rather than "on-save" as with the wikitext PST mode of operation.

Krenair added a comment.Via WebJun 26 2015, 11:02 PM

Substituting things directly on the client? That sounds like we'd run into more issues involving unbalanced html fragments?

ssastry added a comment.EditedVia WebJun 26 2015, 11:09 PM

Substituting things directly on the client? That sounds like we'd run into more issues involving unbalanced html fragments?

Yes, subst directly on the client. In VE, as far as I understand, you cannot add transclusions that generate unbalanced HTML since you have to ask Parsoid for an expansion and you get balanced DOMs always.

So, as far as I can imagine, this subst feature in VE will have to be in-edit substitution of DOMs rather than on-save substitution of arbitrary wikitext.

ssastry added a comment.Via WebJun 26 2015, 11:14 PM

If I have misunderstood this feature and how it would work inside VE, then we should talk more on IRC sometime to get clarity about how this would / should work and update it here, and we can make appropriate updates to the API.

marcoil added a comment.Via WebMon, Jun 29, 6:53 AM

I'm not sure the parsoid API from T73161 is quite what we were looking for. The idea had been to allow the user to mark a template to be substituted upon save, but with this we'd have to substitute an entire transclusion (immediately?)

If you look at this task's description, it asks for being able to do a subst when inserting a template from the template dialog box. Also, according to the description, susbt already works when saving.

Add Comment