Page MenuHomePhabricator

TemplateData: If TemplateData is added to a template page (not a /doc subpage), then it needs to be wrapped in <noinclude> tags
Closed, ResolvedPublic

Description

Details

Reference
bz69149

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:37 AM
bzimport added a project: TemplateData.
bzimport set Reference to bz69149.

Maybe. I'd rather we just fix bug 54140 instead.

Well how would we distinguish a documentation subpage from a "proper" template page?

It's possible that TemplateData could be noinclude'd no matter what. (Would nested noinclude tags cause problems?)

Otherwise, I think we'd have to make assumptions based on the page name. Different wikis use different names, but most use /doc (and/or one other variant), and I've not yet seen an actual template subpage using those names.

(In reply to WhatamIdoing from comment #3)

Otherwise, I think we'd have to make assumptions based on the page name.
Different wikis use different names, but most use /doc (and/or one other
variant), and I've not yet seen an actual template subpage using those names.

Okay, how do you plan for this to work on the ... Swahili Wikia? (if such a thing exists)

I assume that the system would be essentially like this:

  • If the TemplateData is being added to Template:Foo, then add noinclude tags around it.
  • If the TemplateData is being added to Template:Foo/subpage, then check the name of the subpage.
    • If $local-variable is set, amd the subpage matches the local variable, then skip the noinclude tags.
    • If $local-variable is not set, and the subpage is $mw-default-subpage (which should be set to "/doc"), then skip the noinclude tags.
    • Otherwise, assume the subpage is a real template and add noinclude tags.

This means that the way it would work on some future Swahili Wikia is "the local sysops would set the local variable". At the Swahili Wikipedia, local admins would set it to /hati (their preferred page name).

If local sysops did not define the variable, and also didn't use the default subpage name, and someone added TemplateData to a documentation page that the extension treated as a real template, then it would get an "extra" set of noinclude tags (one that it adds and one that the doc page's transclusion adds). I'm not sure that this would harm anything at all, but it's preseumably something to test.

(In reply to Alex Monk from comment #2)

Well how would we distinguish a documentation subpage from a "proper"
template page?

If the title has a "/" in it assume that it's OK to put in without <noinclude>s?

Change 165908 had a related patch set uploaded by Mooeypoo:
Add <noinclude> tags to new <templatedata> strings

https://gerrit.wikimedia.org/r/165908

Change 165908 merged by jenkins-bot:
Add <noinclude> tags to new <templatedata> strings

https://gerrit.wikimedia.org/r/165908

(In reply to JAn Dudík from comment #10)

really fixed?
https://cs.wikipedia.org/w/index.php?title=%C5%A0ablona:Infobox_-
_s%C3%ADdlo&diff=11940098&oldid=11761581

It will be deployed to cswiki in a few hours…

He7d3r set Security to None.