Transcluding wikipedia templates

From Crankshaft Coalition Wiki

Jump to: navigation, search

Wikipedia templates can be used on this wiki via interwiki transclusion.

Contents

[edit] Setup

  1. In LocalSettings.php, set $wgEnableScaryTranscluding to 'true'.
  2. In includes/parser/Parser.php, set $forceRawInterwiki to 'true'.
  3. In the interwiki database table: 'INSERT INTO interwiki (iw_prefix,iw_url,iw_local,iw_trans) VALUES ('wikipedia', 'http://en.wikipedia.org/w/index.php?title=$1',1,1);'

[edit] Usage

Templates are invoked as follows:

{{raw:Wikipedia:templatename|templatevalue}}

So, for example, to invoke the Wikipedia:Template:Rounded template, you can use the following:

{{raw:Wikipedia:Rounded | bg=#f9f9f9 | bc=#aaaaaa | w=75% | content=This is a rounded box template, transcluded from Wikipedia}}

Which would result in the following:

This is a rounded box template, transcluded from Wikipedia

[edit] Miscellaneous

You may run into errors when transcluding a template if the template contains other templates.

[edit] References


Contributors to this page

Jon

Personal tools