VisualEditor: Add support for making some templates directly "visually editable" in the DOM, as if they were tables (e.g. infoboxes)
OpenPublic

Description

screenshot of nested templates in VisualEditor

Templates are sometimes nested into one another. For example, https://en.wikipedia.org/wiki/Template:Chembox relies on sub-templates like https://en.wikipedia.org/wiki/Template:Chembox_Properties , which itself relies on other templates etc.

VisualEditor currently doesn't seem to handle these sub-templates. It shows a nice interface for the top-level template, then shows wikitext for the others (see screenshot).


Version: unspecified
Severity: enhancement

Attached:

bzimport set Reference to bz50182.
gpaumier created this task.Via LegacyJun 25 2013, 3:56 PM
Jdforrester-WMF added a comment.Via ConduitJun 26 2013, 2:08 AM

These are currently supported, just as wikitext. :-)

It depends on some changes in Parsoid (which they've put on ice during deployment), and some tweaks in VisualEditor, but this should be relatively do-able.

gpaumier added a comment.Via ConduitJun 28 2013, 1:52 PM
  • Bug 50355 has been marked as a duplicate of this bug. ***
PamD added a comment.Via ConduitJul 2 2013, 3:45 PM

This bug affects all attempts to edit items in lists which are set out in columns using {{tl|div col}} or {{tl|colbegin}}, so is going to disconcert a lot of editors. I hope it's near the top of the "to-do list": see [[Wikipedia:VisualEditor/Feedback#Editing_within_a_multi-column_list_.28ie_between_.7B.7Bcolbegin.7D.7D_and_.7B.7Bcolend.7D.7D.29]]

GWicke added a comment.Via ConduitJul 2 2013, 3:56 PM

Something like <div class="mw-columns-2"> .. </div> with the proper class definition in common.css would work better for editing in VE, as the wrapper won't be template-generated then.

Generally visual editing works best if a template produces a self-contained part of a page ('properly nested') rather than cut-up start / content / end templates.

Jdforrester-WMF added a comment.Via ConduitJul 2 2013, 6:29 PM
  • Bug 50595 has been marked as a duplicate of this bug. ***
brion added a comment.Via ConduitJul 2 2013, 6:32 PM

Adding keywords to summary to make this searchable.

As noted in bug 50595, this bug prevents copy-pasting formatted text from the main document into a template.

bzimport added a comment.Via ConduitJul 5 2013, 8:02 PM

kwwilliams wrote:

I'm seeing a few comments that imply that nested templates are somehow the result of a poorly thought out design: I take issue with that. Take {{BillboardURLbyName}}, for example: it's got a very simple job: give it the name of a musical artist, and it will return the URL to the Billboard page for that artist's charts or biography. Billboard loves to redesign its site periodically and builds the URL based on six digit numbers, so we really don't want URL hardcoding going on.

It would be a very poor design if we required every template that could accept a URL to understand how to translate an artist name into a URL. It's much better to do it the way we do: pass {{BillboardURLbyName|artist name}} as an argument to templates that require URLs, and let each template do its own job.

PamD added a comment.Via ConduitJul 10 2013, 7:09 AM

We also need to be able to add the template {{tl|multiple issues}} around existing tags: when editing [[Dadloi]] I wanted to add a second maintenance tag and then tidy them up into {{tl|mi}}, but of course had to do the latter in Edit Source after my VE edit.

Jdforrester-WMF added a comment.Via ConduitJul 16 2013, 10:38 PM
  • Bug 51485 has been marked as a duplicate of this bug. ***
SalixAlba added a comment.Via ConduitJul 19 2013, 8:50 PM

This has come up a few times at
http://en.wikipedia.org/wiki/Wikipedia:VisualEditor/Feedback#a_sensible_way_to_edit_.7B.7Bdiv_col.7D.7D_sections
http://en.wikipedia.org/wiki/Wikipedia:VisualEditor/Feedback#Bulleted_lists

In reply to Gabriel Wicke, substing {{subst:div col}} would give <div class="mw-columns-2"> .. </div>. This would work fine for all subsequent edits with VE, but not for editors using wikitext.

Ideally list in {{div col}} blocks would be edited in place. Just as if it was a normal list.

I think this points to a wider question: that some templates are going to need special ways of editing them. You might be able to add a field to the template data, say, "type":"wikitext-block" indicating its a block which should be edited in place. Some sort of extension mechanism could be used, say with an associated lua module providing hints to VE on how to edit the data.

GWicke added a comment.Via ConduitJul 19 2013, 10:20 PM

(In reply to comment #10)

In reply to Gabriel Wicke, substing {{subst:div col}} would give <div
class="mw-columns-2"> .. </div>. This would work fine for all subsequent
edits
with VE, but not for editors using wikitext.

I don't see a big difference between a div start / end tag and {{div col}} / {{div col end}} template pairs. Both are disconnected and of roughly the same text length.

Jdforrester-WMF added a comment.Via ConduitMar 6 2014, 2:48 AM
  • Bug 52786 has been marked as a duplicate of this bug. ***
Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebNov 24 2014, 4:22 PM
Ltrlg added a subscriber: Ltrlg.Via WebMon, Jun 8, 11:09 PM

Add Comment