Jump to content

Topic on Talk:Global templates/Proposed specification

How to do global templates now

5
RhinosF1 (talkcontribs)

From https://lists.wikimedia.org/pipermail/wikimedia-l/2019-December/094062.html:


Global templates is a great idea. It’s done by Miraheze in a sketchy way currently but I’ll explain it.

  • create a template wiki
  • setup an interwiki with transclude set to on
  • set $wgEnableScaryTranscluding to true
  • place {{raw:Interwiki:Template Name}} where you want to use it.,

More complex templates require more work and modules need to be shared etc etc

Cache will need to be properly purged but it will work.

BoldLuis (talkcontribs)

Use Wikidata with TemplateData and translate TempareData for this template.

RhinosF1 (talkcontribs)
Amire80 (talkcontribs)

Thanks! Some questions:

  • "setup an interwiki with transclude set to on" - how is it different from the next point, "set $wgEnableScaryTranscluding to true"? (Sorry if it's a silly question, I've never set up a wiki wgEnableScaryTranscluding myself).
  • place {{raw:Interwiki:Template Name}} where you want to use it - What do the words "raw" and "Interwiki" refer to here? Is "raw" a part of wikitext? I've never encountered it.

Also, other than https://template.miraheze.org/wiki/Interwiki_transcluding_templates, is there anything else written on this topic? I was doing a bit of homework in October while I was writing the first drafts of Global templates/Proposed specification, and all I could find was https://template.miraheze.org/wiki/Miraheze_Template_Wiki, which mostly recommends importing and not transcluding, so it's not very different from what we have at Wikimedia.

Finally, the page "Interwiki transcluding templates" says: "Don't use the method on this page until it's fixed and the above warning has been removed". So does it actually work at Miraheze?

Anything you can write about the problems you have with functional bugs, caching issues, localization challenges, and so on, can be useful for implementing better global templates and for all MediaWiki users.

RhinosF1 (talkcontribs)
  1. Creating an interwiki with transclude set to on is how you define which Interwiki links to which wiki. Setting that to true only allows it to work.
  2. Raw pulls the template code rather than just transcluding the page. Interwiki is the name of the Interwiki link you created.
  3. Not that I’m aware of
  4. It does actually work as I’ve used it.
  5. Not really
Reply to "How to do global templates now"