Last modified: 2010-05-15 15:37:20 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 T5039, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3039 - Unable to Include Custom Scripts from Skins
Unable to Include Custom Scripts from Skins
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.5.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-03 22:11 UTC by Gregory Szorc
Modified: 2010-05-15 15:37 UTC (History)
0 users

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


Attachments

Description Gregory Szorc 2005-08-03 22:11:08 UTC
Some extensions may wish to include custom scripts (like JavaScript) in the <head> of the page output.  Currently, there is no way to do this without 
modifying the skin itself.  However, the functionality is provided in OutputPage::addScript() and OutputPage::getScript() (as referenced by 
OutputPage::headElement() ).  The $wgOut->mScripts variable just isn't available to the skin template.

Solution:

Add:
$tpl->setRef('headscripts', $out->getScript() );

or similar to the appropriate location in SkinTemplate.php (around line 227).  The skins then need to be modified to include this variable.

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


Navigation
Links