Page MenuHomePhabricator

make Special: pages embeddable as templates
Closed, ResolvedPublic

Description

Author: alpeterson

Description:
I'd like all pages to be embedable as a template. "What links here" be able to
be used as a template... actually all pages should be able to be used as a template

and every page should be able to be viewable as a category by passing an option
?view=category or something like that...

and I'd like to have wiki links be able to include a "?", at least the special
pages, because I'd like to be able to link to a "what links here" without a lot
of work, however I just realized that a template would work for that.


Version: 1.4.x
Severity: enhancement

Details

Reference
bz813

Related Objects

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 7:03 PM
bzimport set Reference to bz813.
bzimport added a subscriber: Unknown Object (MLST).

rowan.collins wrote:

I'm changing the summary of this bug to reflect the actual enhancement (i.e. the
part that is not already available) and splitting the seperate issue of
"category view" into a different bug (bug 816) so it can be discussed
seperately. Oh, and as for easily linking to "what links here", you can use the
subpage style: [[Special:Whatlinkshere/User:IMSoP]] will show the backlinks for
the page [[User:IMSoP]].

Any ordinary page can already be included as a template by using
{{Namespace:Pagename}} [e.g. {{User:IMSoP}}] pages in the "main" (article)
namespace must be referenced with a leading ":" [e.g. {{:Main Page}}].
Dynamically generated pages (whose names begin "Special:"), such as
Special:Whatlinkshere, cannot, since they technically have no content (nothing
is stored in the database as being "the content of that page").

One hurdle to making these includable is that they are mostly not written in
Wiki markup, but directly in HTML; whereas, AIUI, the current inclusion system
just grabs raw wiki-text and dumps it in the middle of the page before page
rendering begins. So the content generated by a Special: page would not render
correctly if included by the current mechanisms. May I ask what purpose(s) you
had in mind for this feature?

rowan.collins wrote:

I just had an interesting thought relating to this (in answering a message on
mediawiki-l about running arbitrary PHP):

Maybe SpecialPage.php could have an "executeAsTemplate()" method, which returned
wikitext to be included if the page was requested as an inclusion. That way, it
could return "" by default, and potentially format things differently than
accessing the page normally; and a site administrator could create Special:
pages to do custom bits of php designed for embedding. They could even be given
parameters: either using the sub-page style, like [[Special:Whatlinkshere/foo]]
etc; or, by having template parameters passed to exeuteAsTemplate(), in an
associative array or somesuch, so that you could do
"{{Special:Feed|url=http://example.com/foo.atom}}" or whatever.

avarab wrote:

This is now possible, marking this as FIXED.

gangleri wrote:

adding blocks
bug 2447: allow inclusion of pages with parameters

gangleri wrote:

Hallo!

According to the summary *all* special pages should be includable.
This request is FIXED in "fixed-in-cvs". Is there any reason why it is not
available at the Wikimadia Foundation wikies?

best regards reinhardt [[user:gangleri]]

Special pages *which support it* are includable.