Extension talk:NamespacePreload
Add topicAppearance
Latest comment: 4 years ago by Lonaowna in topic Prevent Template From Expanding
This page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
Prevent Template From Expanding
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
The page mentions "The contents of a message defined in this way is then parsed before being shown to the user, so all templates will be expanded. Basically, it behaves like a standard preloaded template."
How can I prevent this? I can't find any information on this page or the linked Manual:Creating pages with preloaded text page.
I'm currently having to replace {{ with { { to prevent it from expanding. 76.173.103.102 (talk) 19:54, 5 September 2020 (UTC)
- Hi! There's no "nice" way to do this, but you can hack around the issue a bit.
- First, you will need a template (let's call it Template:Lbraces) with the following content:
{{
. - Then, in your preload text replace all occurences of
{{
with{{Lbraces}}
, so instead of{{SomeTemplate}}
you would have{{Lbraces}}SomeTemplate}}
. That should work for your use case just fine. :) Ostrzyciel (talk) 19:24, 6 September 2020 (UTC) - This is now possible since version 1.2.0 with
$wgNamespacePreloadDoExpansion = false
(thanks Ostrzyciel!). Lonaowna (talk) 19:40, 19 January 2021 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.