Page MenuHomePhabricator

Pass cgi variables to pages as {{{variables}}}
Closed, DeclinedPublic

Description

Author: zocky

Description:
This would allow us to make dynamic pages, including pages templated from
several subpages, depending on variables. They could be encoded as
?var_foo=bar&var_baz=faz or another appropriate scheme, with a construct like
{{link:pagename|foo=bar|baz=faz}} to make a link with properly encoded parameters.

This obviously presents some problems for caching, so it may not be appropriate
for large projects like wikipedia. Yet, on smaller projects with different
focus, like Wikinews or Wikisource, this would greatly simplify construction of
portals and other standard pages, which now consist of copies of the same or
very similar code on dozens or hundreds pages, making maintenance and changes
hard on both users and servers.


Version: unspecified
Severity: enhancement

Details

Reference
bz5883

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:14 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz5883.
bzimport added a subscriber: Unknown Object (MLST).

This will never be supported, as it would break too much of the code
and encourage very poor practices.

zocky wrote:

Could you please expand on that answer a bit?

It doesn't need to break any code. Displaying wiki/Inclpage?var_foo=5 would be
exactly equivalent to showing the preview for a page that contains only
{{Inclpage|foo=5}}. That seems to work fine.

I understand the other objection even less. Doing this would allow us to get rid
of a lot of duplicate data. AFAIK, that's good practice, not bad.

URL parameters do not exist in print.

URL parameters do not exist in third-party use.

URL parameters are not cached with the page data.

URL parameters are external to the system.

URL parameters are not a viable or acceptable means of
injecting data into a wiki page.

Under no circumstances will this ever be supported.

robchur wrote:

*** Bug 7179 has been marked as a duplicate of this bug. ***

URL parameters do not exist in print.
:I don't think I understand - "title" is a param too.
URL parameters do not exist in third-party use.
:That's there problem to upgrade.
URL parameters are not cached with the page data.
:Please expand - I don't understand
URL parameters are external to the system.
:Given by user - yes, External? Hm... I don't think so.
URL parameters are not a viable or acceptable means of
injecting data into a wiki page.
:Why? Security shouldn't be different from template params.

I don't really see too much of a difference between params from templates and
params from URL. Except that URL params would give me an ability to make pages
more dynamic and save lots of effort.

For example I could have a template for "Picture of the Day" (on commons) which
would allow me to create one page with all translations, all years and all
months in one.

The code given below would almost work now if this would be available (would
just have to make simple templates {{/url_month-1}} and {{/url_month+1}} with
{{#time}} in them)

[[{{/url_month-1|{{{urlparam_year|{{CURRENTYEAR}}}}}-{{{urlparam_month|{{CURRENTMONTH}}}}}}}|previous
month]]

[[{{/url_month+1|{{{urlparam_year|{{CURRENTYEAR}}}}}-{{{urlparam_month|{{CURRENTMONTH}}}}}}}|next
month]]
{{Potd/Month/full

year={{{urlparam_year{{CURRENTYEAR}}}}}
month={{{urlparam_month{{CURRENTMONTH}}}}}
lang={{{urlparam_lang{{USERLANGUAGE}}}}}

}}

This will never ever be implemented. Please do not reopen it.