Background: for T389892, we want to allow transclusion of the WikiProject list. However, the list is generated in the WikimediaCampaignEvents extension, using the CampaignEventsGetAllEventsContent hook. The tab layout itself is added in the hook handler. The SpecialAllEvents class itself does not know about tabs. This makes it impossible (or extremely awkward) to allow transclusion of a single tabs with syntax like {{Special:AllEvents/communities}}.
One way to fix that is to have the base special page class know about the tab layout, and have hook handlers specify what tabs they're adding content to. Then:
- When the page is transcluded, check if we have a tab name (as in Special:AllEvents/tabname) and output the relevant tab only.
- If no tab is specified, output the default "Events" tab.
- An invalid tab can be treated as if no tab were specified.
- Outside of transclusion: when the hook does not add any additional tabs, do not output the tab layout; instead, output the event list directly (preserve the status quo when WikimediaCampaignEvents is not available)