[WikiEN-l] References in templates

Charlotte Webb charlottethewebb at gmail.com
Sun Jul 13 10:12:03 UTC 2008


On 7/7/08, Finn Aarup Nielsen <fn at imm.dtu.dk> wrote:
> I have been experimenting with having references in templates. I was a bit
> optimistic and tried this variation in a template:
>
> <td><ref name="{{{refname}}}"/>
>
> Where "refname" would be defined on the page with the template embedded,
> e.g., as <ref name="Lesch">{{Cite journal | title=Something }}</ref>
>
> This way didn't seem to work.

This does not have the desired result because when <ref> tags are
inside the template, they populate their own list of refs, separate
from the list of refs in the article where the template is being used.
Apparently the parsing of <ref> tags occurs before transclusions are
even considered.

However it is still possible, for some reason, to use the
<references/> tag via a template, see [[Template:Reflist]] which
offers a myriad of formatting options.

The inconsistency here is arguably less than ideal.

—C.W.



More information about the WikiEN-l mailing list