Hi,
Is there any approved (i.e. non future breaking) way of finding out the stack of what transcluded the page. E.g.
"Top page":
{{:Cool template in state 1}}
"Cool template in state 1":
{{SubDisplay|Hello}}
"SubDisplay":
Do a function {{#myparsefn:{{{1}}}}}
I want to find out the name of "Cool template in state 1" from myparsefn (and preferably also the "Top page", though that is easy to get cos its $wgTitle). Does anyone know of an extension that does this correctly or have any pointers how I might achieve this? Basically I'd like to inspect the parser stack in a safe way...
Kind regards,
Alex
On 9/19/08, Alex Powell alexp@exscien.com wrote:
Is there any approved (i.e. non future breaking) way of finding out the stack of what transcluded the page. E.g.
I've always wanted something like this too, but I'm not very optimistic.
Hidden comments in the html like this would be fine for me: Something like this would be great.
Lorem ipsum dolor sit amet, <!-- begin Template:Foobar --><sup class="foobar noprint">[vacation needed!]</sup><!-- end Template:Foobar --> consectetur adipisicing elit...
These would be least likely to break the html. But what if this template introduces a category (maybe in this case "Users who need a vacation")? Should the link to this category (inside <div id='catlinks'>) be marked as a separate begin/end group? Same with interwikis?
Even if that is the correct behavior it would still be impossible to pinpoint the beginning and end of each transclusion in cases of severe template abuse, Consider this:
{{hyphen}}{{hyphen}}{{hyphen}}{{hyphen}}
In this perverse but trivial example, a template containing "-" can be used 4 times to make a sIIingle "<hr />". Where would you draw the lines? :P
—C.W.
wikitech-l@lists.wikimedia.org