Jump to content

Topic on Project:Support desk

How To Transclude Without Parsing Wikitext?

4
Summary by 197.218.92.61

Safesubst would suffice :

{{safesubst:PAGENAME}}
Johnywhy (talkcontribs)

i'd like the wikitext to get parsed in the context of the host page. Is that possible?

Eg, if source page contains {{PAGENAME}}, i'd like that to get loaded with the pagename of the page that contains the transclusion: {{SourcePage}}

Moreover, i want the parsing to act like it has the subst: prefix. Ie, the pagename of the host page should get hardcoded in the host page. So if the host page is itself transcluded in another host page, it's hardcoded pagename will get forward to the new host.

SourcePage -> HostPage -> AnotherHostPage

{{PageName}} -> "HostPage" -> "HostPage"

Update: This might help, but i don't understand how to do it:

Help:Substitution#Multilevel substitution with independent control of each substitution separately

Ciencia Al Poder (talkcontribs)

I don't think that's possible. What's the point of using {{PageName}} instead of writing down the page name?

Johnywhy (talkcontribs)

i want to each 1st generation host to contain it's own page-name in the wikitext, hardcoded.

Where MyTemplate says "PAGENAME", the Green host should say "Green", not "MyTemmplate".

If a 2nd generation host called "Paint" transcludes page {{Green}}, the transcluded wikitext should say "Green", NOT "Paint".

In other words, i want the Template to contain a placeholder for pagename, and 1st-generation hosts should contain their OWN pagename. Any 3nd-generation hosts should contain the 1st-generation page name.

197.218.92.61 (talkcontribs)

Safesubst would suffice :

{{safesubst:PAGENAME}}
Reply to "How To Transclude Without Parsing Wikitext?"