Last modified: 2009-07-24 12:08:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T2826, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 826 - feature request: "empty template" as {{|parameter1|parameter2}} should be ignored
feature request: "empty template" as {{|parameter1|parameter2}} should be ign...
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
unspecified
PC Windows XP
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://test.wikipedia.org/wiki/User:G...
:
Depends on:
Blocks: 839 2376
  Show dependency treegraph
 
Reported: 2004-11-05 03:25 UTC by lɛʁi לערי ריינהארט
Modified: 2009-07-24 12:08 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description lɛʁi לערי ריינהארט 2004-11-05 03:25:42 UTC
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
Comment 1 lɛʁi לערי ריינהארט 2004-11-05 11:51:04 UTC
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.

- http://test.wikipedia.org/wiki/User:Gangleri/tests/list does what was 
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
Comment 2 Rowan Collins [IMSoP] 2004-11-09 21:37:35 UTC
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.
Comment 3 James Hess 2005-09-25 17:52:42 UTC
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?
Comment 4 lɛʁi לערי ריינהארט 2005-10-13 14:10:21 UTC
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
Comment 5 Happy-melon 2009-07-24 12:08:42 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links