Last modified: 2013-12-27 13:53:04 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T60971, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 58971 - Add a action=render "text" parameter
Add a action=render "text" parameter
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.23.0
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-26 15:05 UTC by Brett Zamir
Modified: 2013-12-27 13:53 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brett Zamir 2013-12-26 15:05:12 UTC
Hi,

I would really like to see a way for external sites to include a subset of content from wiki pages (such as a Wikisource book) without the need for API scripting (e.g., via iframe inclusion) and without the need to first create a page on the wiki to make the exact request (everything would be sent through the URL).

action=render does a fine job (esp. if bug 19415 can be fixed), but it doesn't support grabbing individual sections, including those of the Labeled Section Transclusion extension variety.

Despite what is said for Bug 9711, there are plenty of cases where one does not wish to break up a file into segments when one does not wish the hassle of doing so and wishes to allow users within the site or external to it to have full control of the amount they wish to see at once, whether small or large in size.

My particular use case is allowing people to include paragraph ranges of Baha'i Scriptures from a site I work with (which will be using Flagged Revisions to ensure the content is more reliable on a moment-to-moment basis) without the external sites needing to first create a page which to do the desired (possibly one-off) section transclusion.

My initial thought for an approach was to allow templates to have access to a Magic Word which could grab the query string (so that templates could parse this, say with Scribunto/Lua, into parameter values which could be used in place of {{{1}}} or {{{named|}}} template arguments), but then I realized an even more powerful and general purpose utility (which worked for including templates or external sites) would be to let action=render be made to work with a "text" parameter in a similar to the action=parse "text" parameter.

One could simply build one's own template in the URL, supplying the desired parameters to a template or just directly execute a parser function like the Labeled Section Transclusion extension's calling for section inclusion.

I think it would be wonderful to expose the dynamic power of wikitext as seen in templates and parser functions to external sites, especially since XSS risks or such ought not be an issue here given that any arbitrary text is still getting parsed as though it were any other saved page.
Comment 1 Brett Zamir 2013-12-26 15:17:33 UTC
Oh, and though I know this would probably need a separate bug, I think it ought to make it feasible for http://www.mediawiki.org/wiki/Extension:InputBox to be correspondingly updated to include a new useful type which could provide one input box for a page title (or specification of a hard-coded one), two input boxes for specifying a range of sections, and an input box to specify an anchor within the section range. (The form action could I suppose then simply be dynamically updated in JavaScript to lead to ?action=render&text={{#lsth:pageName|rangeBegin|rangeEnd}}#pageAnchor or into some parameters which would be interpreted equivalently.)
Comment 2 Brad Jorsch 2013-12-26 18:28:14 UTC
Not an API bug. "action=render" is referring to the index.php parameter.[1]

The sort of thing being requested here is already easily possible with the API's action=parse, but the request here is specifically not wanting to use the API.


 [1]: https://www.mediawiki.org/wiki/Manual:Parameters_to_index.php
Comment 3 Brett Zamir 2013-12-27 13:53:04 UTC
I might just mention that maybe the bug should be expanded to mention adding the "text" parameter for "view" and "raw" actions as well given the prior interest by others.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links