Manual talk:$wgEnableScaryTranscluding

I can't get these to work at all. I'm using MediaWiki 1.9.3 with PHP 5.2.1. Whenever I try to include an external template, I get an error message that looks like this:
 * [Template fetch failed for http://en.wikipedia.org/wiki/Template:User_en?action=render; sorry]

I don't think I'm the only person with this problem. I've googled the phrase "Template fetch failed for" and have found several other wikis with this problem as well. The setup for this feature is so simple and so straightforward -- I can't imagine how I could be doing it wrong. - Big Brother 1984 08:24, 11 April 2007 (UTC)


 * Alter the interwiki table and change the URL for Wikipedia (assuming the above example) to http://en.wikipedia.org/w/index.php?title=$1; I recall some problems with the rewritten form. There should also be some more on this in the mediawiki-l mailing list archives. robchurch | talk 08:30, 11 April 2007 (UTC)


 * Changing the URL for Wikipedia made the difference for me. I had to create a new interwiki prefix though to get the system to recognize it. Jlerner 22:07, 19 March 2009 (UTC)


 * Update - I found the problem. It appears that Wikipedia doesn't allow scripts to access its site. Take a look at the user_agent setting in your php.ini. ^>^ However, the function still doesn't work like it's supposed to. Instead of grabbing just the template, it grabs everything that appears on the 'render' page. (Including template usage information) -- Big Brother 1984 08:35, 11 April 2007 (UTC)


 * Another Update - It appears that the software is ignoring the &lt;noinclude> tag. Or rather, the 'render' action causes the template to be returned from the external site without any &lt;noinclude> tags. In other words, when my site requests a template with the parameter "action=render", the external site sends me the everything on the template page, including the text between the &lt;noinclude> tags. This should not be how this works. Perhaps another "action=" parameter needs to be added to the software that will cause the external site to return the template without the data between the &lt;noinlude> tags??? -- Big Brother 1984 09:52, 11 April 2007 (UTC)


 * 3rd Update -- In Parser.php there is a boolean named $forceRawInterwiki. I'm wondering if this could provide a solution to this problem. I tried setting it to TRUE, but that only results in the following error message:
 * [Template fetch failed for http://en.wikipedia.org/wiki/Template:user_en?action=raw; sorry]
 * When I try navigating to that page manually I get a HTTP Error 403 - Forbidden message in my browser. I can't find any documentation for this "raw" feature anywhere, so it's entirely possible that I may be barking up the wrong tree. The only clue as to what $forceRawInterwiki does is a comment in the source code that says that this variable "Forces interwiki transclusion to be done in raw mode not rendered". Can anybody enlighten me as to what this option is actually supposed to do? -- Big Brother 1984 10:55, 11 April 2007 (UTC)


 * Solution -- If you're trying to pull your templates from Wikipedia you'll need to up the $wgHTTPTimeout from 3 to a higher number like 20. To fix up your personal wiki you'll then need to set the $wgTranscludeCacheExpiry to 0 and then you can resave so it'll cache a copy local to your mediawiki. Afterwards set the $wgTranscludeCacheExpiry back to 3600 (1 hour). Cheers -- (ddarcy@digipen.edu) 64.183.53.166 06:25, 25 November 2008 (UTC)


 * 4th Update -- Regarding the 3rd update above. The $forceRawInterwiki variable in Parser.php is relavent. When this is false, the transcluded template is not parsed as template from the local wiki would be. In particular, template parameters are not substituted. It will only work as you would like if $forceRawInterwiki is true. This can be done by setting it directly in Parser.php, but the intention appears to be that you force it by starting the template declaration with the Template Modifier raw. So while will fail to substitute  in the template, we will get the desired effect with  . This raw modifier will result in the error reported above if your interwiki URL is configured incorrectly. The documentation on action=raw states that it may only be allowed when the page is accessed as a primary script access point, that is, when using the "ugly" URL form with index.php?title=.... Changing the URL in your interwiki table to use the ugly form should fix the problem. This whole thing seems nasty, does anyone have a nicer solution? --Mbmcloughlin 19:56, 13 June 2009 (UTC)

What syntax ?
Everything is in the title : can anyone give an example of inter-wiki transcluding ? How should it be written to get a transclusion from here to w:Wikipedia:Transclusion ? --NewMorning 12:55, 29 June 2008 (UTC)
 * Switch the and  with 🇦🇩 in your link above, and you've got it. -- Skiz  zerz  12:58, 6 August 2008 (UTC)

Turning on other namespaces
Is there related work to make this support transclusion from other namespaces? Sj 22:31, 5 August 2008 (UTC)
 * Transclusion from other namespaces is always possible (unless you explicitly forbid it using $wgNonincludableNamespaces). To include a user page, use . To include from the main namespace, use  . HTH -- Duesentrieb ⇌ 08:35, 6 August 2008 (UTC)
 * I'm reading Sj's request as being able to transclude from foreign wikis in namespaces other than Template:. For example, I run two wikis on a site that are very similar and that share the user table via $wgSharedDB and $wgSharedTables.  I'd like for a user to optionally be able to transclude their user page in one wiki to the other so that they only have to maintain one user page.  But right now, it's not possible because everything is being forced through a Template: prefix. --TonyV 16:37, 22 March 2009 (UTC)
 * Solution -- Just add a colon to the beginning after the site prefix. For example, (that's a double colon). If you use only , it'll fetch Template:User:Me. The reason for this is that the server has no way of knowing what is and isn't a namespace on the other Wiki, so it just assumes it isn't one. --71.112.238.184 00:25, 24 March 2009 (UTC)

Is it scary because it doesn't work?
Tisane 09:50, 29 March 2010 (UTC)


 * it's scary because it is totally inefficient and perhaps even broken (I'm not sure). See GSOC for an alternative we hope to have soon --Church of emacs talk · contrib 16:33, 30 May 2010 (UTC)

Does not work on MW 1.16.2

 * MediaWiki 1.16.2
 * PHP 	5.2.17 (apache2handler)
 * MySQL 5.0.77-log

Got an error in php error log: PHP Fatal error: Cannot redeclare class HttpRequest in /local_path_to_site/w/includes/HttpFunctions.php on line 122

when try to use external template from interwiki table

in MediaWiki 1.16.4 it does not work with a different error. In browser I have: [Template fetch failed for http://my.domain/wiki/Template:TemplateName&action=render]

and with the "ugly URL" in interwiki table:

[Template fetch failed for http://my.domain/w/index.php?title=Template:TemplateName&action=render]

Does anybody have a suggestion, please? Pavel Malakhov 10:24, 4 May 2011 (UTC)