Page MenuHomePhabricator

Simple page transclusions are wrongly treated as templates in VisualEditor
Open, Needs TriagePublic

Description

Not only a template, but whatever wiki page can be transcluded in another one by using the {{ ... }} syntax. The VE treats them all the same and suggests to edit the template when in reality there is just a simple page transclusion without any parameters to edit. I would expect the VE to better guide users on how to actually edit the transcluded content.

Example: https://de.wikipedia.org/wiki/Lady_Gaga#Diskografie transcludes https://de.wikipedia.org/wiki/Lady_Gaga/Diskografie. Trying to edit it with VE I get "Transclusion. Generated from: :Lady Gaga/Diskografie"; pressing edit I get "The "Lady Gaga/Diskografie" template doesn't yet have a description, but there might be some information on the template's page." Futhermore, it looks like the line of text before the transclusion is suddenly included into the transclusion while the actual content can't be found to be edited anywhere.

Event Timeline

We handle all transclusions in the same way, whether the page is in the Template namespace or not. The dialog talks about "templates" because that's easier to understand (and translate).

I don't think the transclusion here is "wrongly treated". Can you describe what would be the "correct" way to treat it?

Futhermore, it looks like the line of text before the transclusion is suddenly included into the transclusion while the actual content can't be found to be edited anywhere.

This is because https://de.wikipedia.org/wiki/Lady_Gaga/Diskografie starts with a <templatestyles> tag, which ends up at the end of the preceding line of text of the article, and therefore "marks" the entire line (entire paragraph) as template-generated. We can't really avoid this in VE, it's just an awkward effect of wikitext syntax. You can probably tweak things in the article or the template to avoid this.

Well, calling something a template when it’s not does look wrong to me. Plus, if it can’t be edited, giving users an edit dialogue is very misleading as well. Sure, there are several templates without parameters; but at least with page transclusions from other namespaces that should be obvious enough to be treated differently by the VE. I would expect a dialogue that just says something like “This content is generated by ‘page name’. You can edit it directly on that page.” (with proper linking, obviously). Or leave it as it is and let the “edit” button directly open the other page in a new tab? Something like that, I would think. Page transclusions can never have a “description”, so that note is also very misleading. Since this way of transcluding pages in discographies is standard on deWP, it’s not a small issue; and as far as I know, there are many lists and disambiguations that are composed of transcluded parts as well.

The issue has been pointed out to me recently, that’s why I brought it up here; it’s yet another one of those problems that potentially scare away new users.