Page MenuHomePhabricator

feature request: "empty template" as {{|parameter1|parameter2}} should be ignored
Closed, InvalidPublic

Description

Author: gangleri

Description:
Dear friends,
I try to build two versions of a list from
http://test.wikipedia.org/wiki/User:Gangleri/tests/list_%
28template%29 .

One is for maintenance:
http://test.wikipedia.org/wiki/User:Gangleri/tests/list_%
28maintenance%29
and the other should be an article
http://test.wikipedia.org/wiki/User:Gangleri/tests/list .

There are two ways to do this:
a) an "empty template" as {{|parameter1|parameter2}} should not
be displayed / should be ignored; please note that no
template_name is included
b) some if ($template_name == "") depending on implementation if
($template_name IS NULL)

Regards


Version: unspecified
Severity: enhancement
OS: Windows XP
Platform: PC
URL: http://test.wikipedia.org/wiki/User:Gangleri/tests/list and http://en.wikipedia.org/wiki/User:Gangleri/tests/list

Details

Reference
bz826

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 7:00 PM
bzimport set Reference to bz826.
bzimport added a subscriber: Unknown Object (MLST).

gangleri wrote:

A turnaround was found. See
http://en.wikipedia.org/wiki/User_talk:Patrick#Janus_article .

  • The "old" example is still available at

http://test.wikipedia.org/wiki/User:Gangleri/tests/list_%28old_test_01%29.

intended to be done.

I would be happy if this would be a permanent feature and not a
("possible") "site effect".

  • If the behaviour of "an empty template" would be changed a new solition

should be found.


A construct as
if ($template_name == "") [depending on implementation if
($template_name IS NULL)]
would allow easy insertions (also headers, trailers, ...) to an article.

Regards Reinhardt

rowan.collins wrote:

To clarify, as I understand it, the context is that "{{{{x}}|y|z}}" could be
used to pass a template as a parameter to another template, allowing things to
be formatted differently. But in order to omit the statement completely, you
can't just pass "|x= |", because that leaves you with {{|y|z}}, which is invalid
syntax.

The workaround is to use an existing but empty template as the parameter, so the
text becomes "{{blank_template|y|z}}", and (since Template:Blank_template
contains no text) is rendered blank. I see no reason why this behaviour will
ever change, as it is not a side-effect at all: the template is simply being
included; if it contained the single letter "A", the result would be the single
letter "A". Passing extra parameters to a template has no effect, and nor should it.

mysidia wrote:

Why not make a Template:Empty or Template:Blank and get the effect of
non-inclusion of the template simply by including a template that would produce
no text?

gangleri wrote:

note on comment 2

The workaround is to use an existing but empty template as the parameter, so the
text becomes "{{blank_template|y|z}}", and (since Template:Blank_template
contains no text) is rendered blank. ...

see also bug 2288 comment 3
bug 2288: Suggestion: links to empty pages should show up as uncreated

happy.melon.wiki wrote:

I don't see a need for a software solution to this: the use of a blank template as suggested in comment 2 is a completely stable way to achieve this effect. The potential issue raised in commet 4 (bug 3843: treat links to blank pages as links to nonexistent pages) has been WONTFIXed, partly because of issues with syntax like this. Also totally stale.

epriestley added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:20 AM