Last modified: 2013-02-16 10:09:19 UTC
Parser functions in additional parameters of {{#tag:}} are ignored / thrown away. See https://test.wikipedia.org/wiki/Parser_functions_in_tag_parser_function for demo.
Looking at: {{#tag:ref|general|{{#if:{{{group|}}}|group=g3}}}} I'm pretty sure this parses something like this: #tag:ref unnamed param 1: resolves to "general" unnamed param 2: resolves to "group=g3" while I'm assuming what you want is something like this: #tag:ref unnamed param 1: resolves to "general" named param "group": resolves to "g3" (if 'group' param is present) To get that I'm pretty sure you need the literal "blahblah=" in there, something like: {{#tag:ref|general|group={{#if:{{{group|}}}|g3}} This of course will always add a "group" parameter, but sometimes it will be blank. This may or may not do what you want, naturally.
(In reply to comment #1) > Looking at: > {{#tag:ref|general|{{#if:{{{group|}}}|group=g3}}}} > > I'm pretty sure this parses something like this: > > #tag:ref > unnamed param 1: resolves to "general" > unnamed param 2: resolves to "group=g3" > > while I'm assuming what you want is something like this: > > #tag:ref > unnamed param 1: resolves to "general" > named param "group": resolves to "g3" (if 'group' param is present) > > To get that I'm pretty sure you need the literal "blahblah=" in there, > something like: > > {{#tag:ref|general|group={{#if:{{{group|}}}|g3}} > > This of course will always add a "group" parameter, but sometimes it will be > blank. This may or may not do what you want, naturally. I actually originally used |group={{{group|}}} construction, but it had issues because then it behaved like named group, so instead of <references /> you had to put <references group="" /> which is obviously uncomfortable. There might be other tags, where empty param value is valid construction and is not ignored, so the solution you propose is unfortunately not applicable to these situations.
A empty group is ignored by Cite extension, so {{#tag:ref|general|group=}} is not shown with <references group="" /> Looks working for me.
(In reply to comment #3) Where were you testing that?
I apologize. I was writing it out of memory, but made a mistake. The problem was with naming. (Empty) parameter name="" was the issue. {{#tag:ref|ref1|name={{{name|}}}}} {{#tag:ref|ref2|name={{{name|}}}}} <references /> It *groups* (hence (and Brion's comment) why I was originally writing about group instead) them under the reference number of the first text and show only that one. However, this is different issue (if it is incorrect and not intended behavior), this bug is about parser functions ignored.
Not sure of the best way to fix this. This actually comes around from an intentional feature. Templates and parser functions use literal names so that in something like say: Sandbox: {{A|text=a=b}}} Template:A: {{B|{{{text}}}}} Template:B: {{{1}}} In Template:A the text "a=b" is not interpreted as {{B|a=b}} resulting in Template:B breaking.
Yes, a empty name is treated as a valid name, so that does not help here. I think it is a feature, that a equals sign in the value of a param is treated as plain text and not as key=value, because than you can override param usage in sub templates. So the example above would work, because Template A is expand to {{B|1=a=b}}, which works and looks expected. Maybe Cite should be fixed for empty names, it is a breaking change, but the most use of that should be wrong use.