Page MenuHomePhabricator

Magic word to add supplemental text above edit box for a particular page
Closed, DuplicatePublic

Description

Please add either {{EDITINTRO|<pagename>}} or {{editintro:<pagename>}} (or any
other form you prefer)

It should modify the URL of "edit" tab with adding of (already existing)
editintro= parameter to query string.

Thanks


Version: unspecified
Severity: enhancement

Details

Reference
bz8260

Event Timeline

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

robchur wrote:

I don't quite understand what's meant here, or what this would be used for.

If you load the article, it has "edit" tab and when you click on it, you'll get
the regular editing page.

The idea is, if the article had this magic word inside, then when you click on
"edit" tab, it would show some information (= the content of <pagename> in
parameter) above editing window.

Therefore the edit tab link would be
/w/index.php?title=<article>&action=edit&editintro=<pagename_from_magic_word_parameter>
instead of current
/w/index.php?title=<article>&action=edit

robchur wrote:

Example applications? There might be a more appropriate means of doing this.

rockmfr wrote:

A question much like this one came up at http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_%28technical%29&diff=218485159 . Assuming you have a wiki that isn't prone to abuse, a general solution to this problem that would not require changes to MediaWiki would involve something like this:

  1. Create Template:EDITINTRO with the following contents:

<div id="editintro-name" style="display:none">{{{1|}}}</div>

  1. Add something like this to your wiki's common.js:

addOnloadHook(function() {

if (document.getElementById('editintro-name') && document.getElementById('ca-edit')) {
  var editLinks = document.getElementById('ca-edit').getElementsByTagName('a')
  if (editLinks.length > 0) {
    editLinks[0].href += '&editintro=' + document.getElementById('editintro-name').innerHTML
  }
}

});

  1. Create a template containing your editintro (e.g., Template:Foobar).
  1. Place {{EDITINTRO|Template:Foobar}} on any page.
  • This bug has been marked as a duplicate of bug 15102 ***