On Mon, Dec 26, 2011 at 7:47 AM, Henning Wangerin <
100624(a)henning.wangerin.dk> wrote:
I'm working on a booking-extension for booking
events for my users.
To make management easy, I have my event-pages simply to include
{{Special:Booking}} to be put into the booking- and calendar-list.
Is there a way to get the page-id of the parent-page?
It's easy to se if the special-page is included in another page, but I
want to show dates, prices etc depending on the page being viewed.
Any hints, or do I have to to split the extension into a special-page +
a tag-extension?
The system for includable special pages goes pretty far out of its way to
hide the current context so the special page code sees its own expected
context, so this probably isn't super easy.
I'd probably recommend using a tag extension or parser function, since
those are more 'cooperative' with the parser and can ask it for the page
title it's working within.
You can call common code from both the special page and your tag or
function hook, so this doesn't have to make things _too_ much more
complicated, and it'll probably be easier to have tag-friendly parameter
handling.
-- brion