Project talk:VisualEditor testing/Template test

From mediawiki.org
Latest comment: 10 years ago by This, that and the other in topic Editing TemplateData-hinted templates

Editing TemplateData-hinted templates[edit]

This doesn't seem to work yet? This, that and the other 2013-06-18

What doesn't work about it? Jdforrester (WMF) (talk) 00:35, 18 June 2013 (UTC)Reply
Well, if you try to edit the "unsigned" template, you are offered the parameters "1" and "2". The templatedata doesn't seem to be influencing the template editor dialog in any way. Perhaps I am misunderstanding what is meant to happen here? This, that and the other (talk) 02:39, 18 June 2013 (UTC)Reply
That's because the template doesn't have names for its parameters. However, if you look at the template's "main panel", you can see the description ("Label unsigned comments in a conversation, to attribute them to the correct user."). It's meant to be an example basic case. Jdforrester (WMF) (talk) 03:50, 18 June 2013 (UTC)Reply
Jdforrester: Hmm, the "aliases" seem to be overriding the "label", if I understand it correctly. Can this be changed? There are a lot of templates that take {{{1|}}} {{{2|}}} etc, as their entry values. Quiddity (talk) 16:12, 19 June 2013 (UTC)Reply
Once this is done (or decided against), we should start an "adding templatedata" how-to page at en:Wikipedia:WikiProject Templates/Templatedata.
and some notices at VPT etc. Quiddity (talk) 19:24, 19 June 2013 (UTC)Reply
Yeah, there's a bit of breakage, regressions and not-yet-done-ness of using TemplateData in VisualEditor, which we hope to fix very soon - see bugzilla:49833. Oliver is keen to help with that documentation BTW. Jdforrester (WMF) (talk) 19:46, 19 June 2013 (UTC)Reply
I'm also curious as to why this was not implemented as a table (with a column for parameter name and a column for value) - the whole two-panel paradigm seems to "heavy" for something as simple as a template transclusion. And the bit about adding "content", and adding several templates within the one "transclusion", is completely incomprehensible for me. This, that and the other (talk) 01:04, 20 June 2013 (UTC)Reply
On the first point, transclusions' parameterised content can be significantly more complex than just a basic wikitext field - these can be proper DOM elements, so we need the UI space for them. Right now we're only allowed editing of the wikitext, but soon enough they'll normally be DOM elements with fall-back for items that can't be. A "simple table" wouldn't be flexible enough for the demands that (e.g.) infoboxen templates have of their contents.
On the multi-template block issue, this is for situations where multiple templates in and of themselves don't create a balanced DOM element; the most common example of this on-wiki are templates that go together like:
Note that there are a lot of similarly-awkward templates (like those that apply a few "standard" settings to an image, thus altering a or ). The "content" blocks are wikitext blocks in between the templates (or non-template transclusions, like usage of parser functions), which similarly can be unbalanced DOM nodes. Parsoid (and anything sane that handles HTML editing) deals in DOM elements, so we have to provide the user with a way to edit these "as one". The only other alternative would be to prevent VisualEditor editing of these elements entirely, which would be, ahem, not a good experience for our users. A VisualEditor that doesn't support the third most widely-used set of templates on enwiki is pointless. Telling the community that's it's not cool for them to come up with a completely different system clearly isn't going to fly. More details here if you're curious. (BTW, yes, this is one of the reasons VisualEditor/Parsoid is slower than you'd like.)
To put it another way: we'd love to do it simply, but our users keep coming up with yet-more-complex/-broken/-maddening ways to use MediaWiki, and we need to support those uses. Jdforrester (WMF) (talk) 01:37, 20 June 2013 (UTC)Reply
Thanks for that excellent explanation. I'll remember to link to it frorm enwiki if it is ever needed.
I think the user interface is very unclear though! It does not provide any clue whatsoever on what "content" is supposed to be... This, that and the other (talk) 08:13, 20 June 2013 (UTC)Reply
See en:Wikipedia:VisualEditor/Feedback#Progress! for a situation where this dialog layout is obviously problematic. However, perhaps the template in question needs to be updated to use Lua, then it wouldn't need to use all the parameters! This, that and the other (talk) 01:22, 21 June 2013 (UTC)Reply
Olivier! I bet he loves that. ;P
Re: documentation, he's welcome to it! The only suggestion I have is that we might want to prioritize en:Wikipedia:Database reports/Templates transcluded on the most pages, but that list includes templates that aren't used in mainspace, so it's not at all perfect. Beyond that, it's out of my depth. Quiddity (talk) 03:58, 20 June 2013 (UTC)Reply
@Quiddity: Whoops. :-) Yes, that DB report is a useful start, though there's also the issue of meta-templates that aren't directly used on articles either (and so similarly don't need TemplateData for VisualEditor purposes). Jdforrester (WMF) (talk) 04:07, 20 June 2013 (UTC)Reply