Page MenuHomePhabricator

VisualEditor: Be able to name references manually in the reference dialog
Open, LowPublic

Description

If you create a new reference, you can specify a name - great! If you try to modify an existing reference to add a name... https://en.wikipedia.org/wiki/File:VEReferenceEdit.jpg oops.

Details

Reference
bz50568

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:01 AM
bzimport set Reference to bz50568.

Actually, it even looks like the ability to name a reference has been removed from the reference creation interface. Expanding the scope of this request accordingly.

Being able name references is an important step to allow compatibility with the classic wikitext editor: human-readable names are much easier to use than names like ":5".

Editor APerson at en.wp, is asking for this and suggests that the name of a reference could be set in the "Options" section along with the group name.

It would even be convenient if VisualEditor suggested a unique label for the ref, perhaps using the first alphabetic string of characters in the ref (usually the first author's last name).

Useful for default would be to read from the parameters of the cite template if provided. The following would be a useful preference order I think

  1. Lastname and Year (e.g. Smith2013)
  2. Author and year (e.g. Bob Smith2013)
  3. Lastname and serial number (e.g. Smith001)
  4. Title (first 3 words) and year (e.g. FreddieStarrAte1986)
  5. domain, underscore, page name (If only a bare url is given) (e.g. bbc_magazine-23969607)
  6. fist alphabetic string in reference (when neither a template or a url) and a string of four digits from the reference (e.g. Jones1999)
  7. fist alphabetic string in reference and a serial number (when neither a template or a url and no sequence of four digits is present) (e.g. Brown001)
  • Bug 57459 has been marked as a duplicate of this bug. ***

Perhaps Citoid could suggest a ref name.

Mvolz added a subscriber: Mvolz.Feb 26 2015, 6:43 PM

The citoid extension could definitely come up with an automated reference name, but that should be filed as a separate issue as a feature request :). For editing citations, the extension uses the same reference dialog as the rest of VE.

Mvolz removed a project: Citoid.Feb 26 2015, 6:44 PM
Mvolz set Security to None.

Here's another idea for an automatically suggested (but still editable) ref name that would work with manually formatted citations:

Use the longest text string is in the citation, appending numbers as necessary to keep the names unique. You might end up with a lot of refs named "September", but it in many cases it will pick up the most significant keyword in the source's title.

Risker added a subscriber: Risker.Mar 5 2015, 2:47 AM

At the triage meeting on 11 March it was agreed that this is too complex and imprecise to keep as a Q3 objective, but that a much more on-point task, T92432: Come up with a better way to auto-label references, could be done instead.

If you create a new reference, you can specify a name - great!

It's no longer possible to specify a name even when creating a new reference.

Krinkle removed a subscriber: Krinkle.Jan 25 2017, 11:52 PM
Izno added a project: Cite.Nov 20 2017, 2:19 AM
Izno updated the task description. (Show Details)
Izno moved this task from Unsorted backlog to External on the Cite board.Nov 20 2017, 2:26 AM

If we try to name a reference by only using a numeral, the system rejects it and says that numeral only reference names are not permitted.
I feel it is bogus that Visual Editor gets around this by adding a colon: e.g. - :17
That kind of reference name is wrong and unhelpful.
I hope that the ability to manually name references, or at least the ability to manually approve the generated name is restored.

Dvorapa removed a subscriber: Dvorapa.Nov 28 2017, 11:07 AM
gpaumier removed a subscriber: gpaumier.Jul 18 2018, 5:57 PM

When this is implemented it needs to take account of reused references:
i.e. if <ref name="Smith">...</ref> is renamed to <ref name="Jones">...</ref>
then all instances of <ref name="Smith" /> need to be automatically changed to <ref name="Jones" />

Thought will need to be given to the interaction of this and section editing.

matmarex added a subscriber: matmarex.EditedNov 19 2018, 6:05 PM

When this is implemented it needs to take account of reused references:
i.e. if <ref name="Smith">...</ref> is renamed to <ref name="Jones">...</ref>
then all instances of <ref name="Smith" /> need to be automatically changed to <ref name="Jones" />

This is actually a very good point, and I think this actually makes changing the name impossible in some cases. (But it should be possible to allow setting the name for newly created references.)

Consider a page like this:

Lorem ipsum dolor sit amet, consectetur adipisicing elit.<ref name="example">http://example.com/</ref>

{{columns-list|
* [[George Washington]]
* [[John Adams]]<ref name="example" />
}}

<references />

If you were to use VE to change the name of this reference, we would not be able to update the reuse inside the {{columns-list}} template, because the entire template is "opaque" – VE doesn't know about anything inside of it, it just displays the content.

Thryduulf added a comment.EditedNov 20 2018, 8:44 PM

My first thought is that this wont remain opaque to VE forever and so what is required is a workaround that exposes to VE some aspects about the contents of templates like {{columns-list}} even if cannot be edited yet.
For example, the template could expose metadata like:

References included:  'Smith' 'Jones' 'Patel'

where each of those is the name= parameter of a reference used inside it.

This would allow VE to display and error along the lines of "Cannot rename reference "Jones" - used in uneditable block. It would also prevent the naming of a new reference with a conflicting name.

It may also be useful for T52474 and similar tasks.

How significant this would be to program I haven't the foggiest though.

This has been proposed as part of the 2019 Community Wishlist: https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2019/Citations/VisualEditor:_Allow_references_to_be_named It's too early to know whether it will make the top 10 (voting will be open until the 30 November 2018), but it's currently among the more popular items, which suggests that solving this problem has widespread community support.

Cirdan added a subscriber: Cirdan.Jun 6 2019, 2:56 PM