VisualEditor: Support editing citations defined within a template
Open, NormalPublic

Description

For example, look at https://en.wikipedia.org/w/index.php?title=Peach_Springs_Trading_Post&oldid=563257259&veaction=edit.

Citation [1] is defined inside the infobox template. It is then reused at the end of the first paragraph, but when you click the [1] there, you get an inspector with the message: "This reference is defined in a template or generated block and for now can be only edited in source mode."

This also comes up when citations are defined within a template like {{reflist}}, as at https://en.wikipedia.org/w/index.php?title=Helminthopsis&oldid=592365854.

See Also:
T53289

bzimport set Reference to bz50896.
TheDJ created this task.Jul 7 2013, 7:22 PM

This should NOT be a low priority. It's quite common for an article to have ALL references inside a template - see, for example, https://en.wikipedia.org/wiki/Helminthopsis .

At the moment, VE is able to figure out that the citation information is elsewhere - a tooltip appears that says "This reference is defined in a template or other generated block, and for now can be only edited in source mode." If VE can figure that out, then it should be able to perform the following three additional steps:

  • Check if the information is in the {{reflist}} template (match the "ref name=" parameter in the body of the text to a ref name parameter within the reflist template)
  • If a match is found, pull the relevant citation information from the reflist template, allowing the user to edit it
  • After the edit is finished, put the (modified) citation information back into the reflist template

(Side note: for edit conflict purposes, this is an edit of the section where the reflist template is located, not where the footnote label exists within the body of the text).

If VE is NOT modified to allow users to edit such references/citations, users are going to be (randomly) frustrated because they can't edit any footnotes in some articles using VE (see above) and because in some articles (https://en.wikipedia.org/wiki/Pope_Francis , for example), there are occasional footnotes that aren't editable in VE.

(In reply to John Broughton from comment #1)

This should NOT be a low priority. It's quite common for an article to have
ALL references inside a template - see, for example,
https://en.wikipedia.org/wiki/Helminthopsis .

At the moment, VE is able to figure out that the citation information is
elsewhere - a tooltip appears that says "This reference is defined in a
template or other generated block, and for now can be only edited in source
mode." If VE can figure that out

We figure that out because we can tell that there's no actual reference on the page, so presumably it was made with a hack.

, then it should be able to perform the following three additional steps:

This doesn't actually follow.

  • Check if the information is in the {{reflist}} template (match the "ref name=" parameter in the body of the text to a ref name parameter within the reflist template)

No. That would require making up a list of hack templates that each wiki uses, which is a WONTFIX if ever there was one. See instead bug 51260 which will mean we can get rid of this class of template hacks once and for all.

  • If a match is found, pull the relevant citation information from the reflist template, allowing the user to edit it

Again, this would require a list of hack extraction approaches for each of the hack templates. WONTFIX. Sorry, but these templates are ghastly abominations and should have been strangled at birth.

  • After the edit is finished, put the (modified) citation information back into the reflist template

That requires magic psychic modification of wikitext. Yet again, WONTFIX. Sorry.

(Side note: for edit conflict purposes, this is an edit of the section where
the reflist template is located, not where the footnote label exists within
the body of the text).

You are mistaken about how edit conflict detection works. Sections don't come into it. See endless suggestions and bugs passim where this myth has been disproven.

If VE is NOT modified to allow users to edit such references/citations,
users are going to be (randomly) frustrated because they can't edit any
footnotes in some articles using VE (see above) and because in some articles
(https://en.wikipedia.org/wiki/Pope_Francis , for example), there are
occasional footnotes that aren't editable in VE.

Or, alternatively, we could dump the stupid templates that make it harder for users even using wikitext to know what on Earth is happening, and instead use the wikitext the way it was designed, without resorting to hacks of doom?

He7d3r added a subscriber: He7d3r.Jan 29 2015, 8:50 PM
Neil_P._Quinn_WMF changed the title from "VisualEditor: Be able to edit references defined within a template" to "VisualEditor: Support editing citations defined within a template and reused outside it".Aug 4 2015, 7:32 PM
Neil_P._Quinn_WMF edited the task description. (Show Details)
Neil_P._Quinn_WMF raised the priority of this task from "Low" to "Normal".
Neil_P._Quinn_WMF set Security to None.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 4 2015, 7:32 PM
Neil_P._Quinn_WMF changed the title from "VisualEditor: Support editing citations defined within a template and reused outside it" to "VisualEditor: Support editing citations defined within a template".Aug 4 2015, 7:34 PM
Neil_P._Quinn_WMF edited the task description. (Show Details)
Stryn added a subscriber: Stryn.Dec 11 2015, 2:51 PM

Why isn't this given a higher priority, and/or assigned to someone? This issue affects every article that has an infobox with one or more citations, and that's a VERY large number, and continually increasing - and a high percentage of the most viewed articles DO have infoboxes.

More importantly, this isn't just an issue of problems with reuse: having a citation/footnote in a template such as an infobox also disrupts the numbering system for footnotes - the numbering that what appears in the body of an article, when in VE editing mode, doesn't match the list of footnotes shown in VE editing mode. That's obviously a source of confusion to those doing editing; again, this certainly affects thousands of articles, and quite probably tens of thousands.

We want as much information as possible in Wikipedia articles to have inline supporting sources, and infoboxes are extremely popular (and helpful to readers). But the combination - citations inside templates such as infoboxes - is currently disruptive when editing using VE. That should be fixed.

Add Comment