Page MenuHomePhabricator

indicators with template parameters can't work
Closed, DeclinedPublic

Description

Page status indicators with tempalte parameters can't work:

<indicator name="{{{id|}}}">[[File:Foo.svg|20px]]</indicator>


Version: unspecified
Severity: normal

Details

Reference
bz73450

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 4:00 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz73450.
bzimport added a subscriber: Unknown Object (MLST).

The solutation for <tags> with template params is using of the {{#tag:}} parser function (the same for indicator or ref or references or ...)

Use {{#tag:indicator|name={{{id|}}}|[[File:Foo.svg|20px]]}}

(In reply to Umherirrender from comment #1)

The solutation for <tags> with template params is using of the {{#tag:}}
parser function (the same for indicator or ref or references or ...)

Use {{#tag:indicator|name={{{id|}}}|[[File:Foo.svg|20px]]}}

{{#tag:}} error:

Error: Page status indicators' name attribute must not be empty.

see https://en.wikipedia.org/wiki/User:Shizhao/sandbox

source:
{{#tag:indicator|name=foooo|[[File:cscr-featured.svg|20px]]}}

The parameters need to be provided in this order:

{{#tag:indicator|[[File:cscr-featured.svg|20px]]|name=foooo}}

(In reply to Bartosz Dziewoński from comment #3)

The parameters need to be provided in this order:

{{#tag:indicator|[[File:cscr-featured.svg|20px]]|name=foooo}}

thx. I see

The <indicator name="{{{id|}}}">[[File:Foo.svg|20px]]</indicator> syntax probably will not be supported: as far as I know no other tags support arbitrary wikitext in attributes and I wouldn't want to make this one different. I copied a few people who might have an opinion on this, anyone wants to say anything?

As was previously mentioned, just use #tag if you need this. I see no reason to make this tag special.

(In reply to Bartosz Dziewoński from comment #5)

as far as I know no other tags support
arbitrary wikitext in attributes and I wouldn't want to make this one
different.

Ah, interesting. I didn't know this. At one point, Gabriel and I had been fretting about templated attributes for extensions.

Parsoid already has some support for this, but we won't bother continuing to test and work on this.

Ex: https://gerrit.wikimedia.org/r/#/c/65575/ is an abandoned attempt.

There are some FIXMEs in the code about the gaps which we'll remove and explicitly document that this feature doesn't need to be supported.

Aha! See what I had forgotten. https://phabricator.wikimedia.org/T58916 .. There is always an exception in the wikitext world to any constraint we might cook up. Looks like <ref> is special. But, I am going to use this discussion here to suggest that <ref> should also move to using #tag where it needs arbitrary wikitext / templates in attributes.

Ha! But note that if you change Cite to use escapeIdForAttribute instead of escapeId (as per https://gerrit.wikimedia.org/r/378774 and T176170), then it starts to expand the wikitext in the id, which T58916 says it shouldn't. :( So Cite was probably just "buggy" rather than "special".... sigh.