Topic on Project:Support desk

How to Freeze MagicWords (or the whole transclude) in a Sequential Transclude?

2
Johnywhy (talkcontribs)

Template:Tag contains a transclusion to a Special page, with magicwords:

{{Special:WhatLinksHere/Tag:{{PAGENAME}}}}

Page Tag:Banana transcludes Template:Tag.

{{Tag}}

It renders correctly.

Pies (transclusion) ‎ (← links | edit)
Draft:Milkshakes (transclusion) ‎ (← links | edit)
Draft:Ice-Cream Sundaes (transclusion) ‎ (← links | edit)

The desire is to "freeze" the transclude (or just the magicword) at that page, so subsequent transcludes will not re-parse the original transclude or magicWords.

But that's not what happens.

Page3 transcludes page Tag:Banana.

{{Tag:Banana}}

Page3 doesn't render correctly. I get a blank. I believe the reason is that {{PAGENAME}} gets re-parsed as "Page3", which then is used as the original Special page parameter.

We don't want that to happen at Page3. We want the Page3 render to look just like the page Tag:Banana render.

Is that possible?

Bawolff (talkcontribs)

Not really, but what you can do:

Make Template:DisplayTag be

{{Special:WhatLinksHere/Tag:{{{1}}}}}

Then make Template:Tag be:

{{DisplayTag|{{<includeonly>safesubst:</includeonly>PAGENAME}}}}

And any time you use {{tag}}, instead use {{subst:tag}}, which at save will get magically turned into {{DisplayTag|CURRENT PAGE NAME HERE}}

Reply to "How to Freeze MagicWords (or the whole transclude) in a Sequential Transclude?"