Is it possible to transclude a page, but preserve magic, page-specific variables like {{PAGENAME}}?
Let’s say I have two pages:
TranscludedPage which contains {{PAGENAME}} and ParentPage which transcludes the former page with {{:TranscludedPage}}. As it turns out, {{PAGENAME}} will show ParentPage. What want it to do is to display TranscludedPage. Or, put differently, I want render the page as it would be rendered as an independent page, and then include it.
There is no way to do that directly in current MediaWiki (at least: which I know of). Basically, the
{{PAGENAME}}’s raison d’être is exactly the opposite. If you need static content (not changing upon inclusion), save the TranscludedPage with{{subst:PAGENAME}}, and you’ll get static content.(I guess there are various tricks on various levels (API, Speical:ExpandTemplates, custom extension) which could do something similar, but that would depend on what you really need to achieve.)