Get our free book (in Spanish or English) on rainwater now - To Catch the Rain.

Template talk:Attrib pd

From Appropedia
Jump to: navigation, search

Debugging[edit]

this has been fixed with the help of the #MediaWiki IRC channel (see below) and is kept only for historical reasons. --Chriswaterguy · talk 00:41, 8 January 2008 (PST)

The example above doesn't work, so test something very simple:

This page or section contains public domain content from {{{url}}}. (See the [{{{statement}}} public domain statement].)


But we actually need an external link, and for some reason this breaks the template:

This page or section contains public domain content from {{{url}}}. (See the [{{{statement}}} public domain statement].)


Try editing the template, naming the arguments:

This page or section contains public domain content from {{{url}}}. (See the public domain statement.)



Debugged with the help of MediaWiki IRC[edit]

I went to the #mediawiki IRC channel and got help to debug this. Edited transcript posted with the permission of Splarka (many thanks for the help, Splarka!):

<Chriswaterguy> I'm having trouble getting the arguments in a template to work - [Template:PD_source http://www.appropedia.org/Template:PD_source] and a couple of debugging notes on that page - is this the right place to ask?
<Chriswaterguy> when the first argument contains an external link it doesn't work -the second argument is being inserted where the first argument should go.
<Splarka> Chriswaterguy: probably the equals sign
<Splarka> try 1=
<Splarka> {{templatename|parameter=value|parameter=value}}
<Splarka> if there is no equals sign between pipes, the parameters are numbered starting at one, but if there is an equals sign, everything to the left of the sign is the name of the parameter
<Splarka> so having a URL with a = in it screws up the numbering
<Splarka> so this should work: {{PD source|1=[[http://www.eere.energy.gov/buildings/database/overview.cfm?projectid=82 http://www.eere.energy.gov/buildings/database/overview.cfm?projectid=82] Buildings Database: Overview - Cambridge Cohousing] - [[EERE]] (Energy Efficiency and Renewable Energy), U.S. Department of Energy|2=[http://www.eere.energy.gov/buildings/database/queryhelp.cfm http://www.eere.energy.gov/buildings/database/queryhelp.cfm]}}
<Chriswaterguy> Splarka: ahhh never seen that form before. Thanks!
* Chriswaterguy tries that
<Splarka> the easiest solution is to just give them names
<Splarka> eg: :”This page or section contains [[public domain]] content from {{{link}}}. (See the [{{{statement}}} Public domain statement].)”
<Splarka> {{PD source|link=[[http://foo/ http://foo] bar]|statement=[http://foo/ http://foo]}}
<Chriswaterguy> Splarka: that's a great solution - easier for people to follow too
* Splarka nods
Further suggestions from Splarka
<Splarka> you could get cleverer too...
<Splarka> :”This page or section contains [[public domain]] content from {{{combinedlink|[{{{link}}} {{{linktext}}}]}}}. (See the [{{{statement}}} Public domain statement].)”
<Splarka> then you could define either combinedlink=[[http://foo/ http://foo] bar] or link=[http://foo/ http://foo] and linktext=bar
<Chriswaterguy> Splarka: - that's working, many thanks! Not sure about the second version - lots of {{{ and }}} is a bit confusing for the eye, I find.
<Chriswaterguy> Splarka: btw I'll put an edited transcript of this convo on the talk page - presume that's okay?
<Splarka> Chriswaterguy: fair enough, that is just parameter defaults.. for example ”default” would show the text "default" in italics if they omitted a parameter
<Splarka> chris: no prob for me (ask permission of anyone else you quote though)
<Splarka> well, this chan is publically logged, so maybe you don't need to...
<Splarka> http://tools.wikimedia.de/~amidaniel/chanlogs/%23mediawiki/20071222.txt
<Chriswaterguy> cool, thanks!


--Chriswaterguy · talk 18:46, 21 December 2007 (PST)