Hi, I would like to be able to include/transclude an excerpt from a page. Can anyone suggest how to do this with MediaWiki?
I have been thinking about several things: - set up a separate name space like Talk, and associate and place each excerpt as a subpage to a page's excerpt page - transclude a section, sort of like how Edit of a section works - add new tags and hooks - use noinclude and includeonly in a clever way using macros
Has anyone done something like this, and care to share some experiences?
Thanks - henrik
Well, I solved it myself - wasn't that difficult using the ParserExtensions like if, ifeq. Here is an example that allows inclusion using different tags.
On a page called Test <includeonly> When including this page, this text is always included. {{#ifeq:{{{tag}}}|foo| FOOTEXT HERE This text is included if this page is included with the tag set to foo}} {{#ifeq:{{{tag}}}|bar| BARTEXT HERE If tag is set to bar, then this text is included}} {{#if:{{{tag}}}| ALL TAGS This text is included if the tag is set to any value except being blank | If not tagged, this text is shown.}} <br> This text is always included. </includeonly> <noinclude> This is the normal text that is shown on the regular page. It is not included anywhere. </noinclude> *EOF*
To include/trigger all the different variations on another page : {{:Test|tag=foo}} or {{Test|tag=bar}} or {{Test|nonexistant}} or just {{Test}}
- henrik
"Henrik Lindberg" glashammer@hotmail.com skrev i meddelandet news:ed9ilf$s04$1@sea.gmane.org...
Hi, I would like to be able to include/transclude an excerpt from a page. Can anyone suggest how to do this with MediaWiki?
I have been thinking about several things:
- set up a separate name space like Talk, and associate and place each
excerpt as a subpage to a page's excerpt page
- transclude a section, sort of like how Edit of a section works
- add new tags and hooks
- use noinclude and includeonly in a clever way using macros
Has anyone done something like this, and care to share some experiences?
Thanks
- henrik
mediawiki-l@lists.wikimedia.org