[Mediawiki-l] conditional transclusion?

Scott Morrison scott.morrison at gmail.com
Sat Jul 30 19:31:17 UTC 2005


Hi,

I've looked around the help on meta about templates, but I can't seem
to find anything on this. I would like to be able to 'conditionally
transclude' a page, based on whether the page is empty or not.

Specifically, I'd like to have something like
    {{conditional transclude | page_name}}
which transcludes the content of page_name if it is nonempty, but
*does not* put at edit link to this page if it is empty.

A useful extension of this (for me) would be
    {{ctp | prefix | page_name}}
which produces "prefix {{page_name}}" if page_name is nonempty, but
nothing if it is empty.

Any pointers? Has this been done somewhere before? Is it possible?

Thanks,
scott morrison



More information about the MediaWiki-l mailing list