Last modified: 2013-09-04 11:48:18 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 T31541, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29541 - Request for headelement hook
Request for headelement hook
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.17.x
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-22 22:24 UTC by Subfader
Modified: 2013-09-04 11:48 UTC (History)
1 user (show)

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


Attachments

Description Subfader 2011-06-22 22:24:03 UTC
Skins use 

$this->html( 'headelement' );

now for the complete head section. How can I adjust the meta tags?

The OutputPageBodyAttributes hook is only for the body tag.

In 1.16a I used to manipulate the meta description directly. Bow I cannot change a single tag of the head section.

Sorry if I miss something and major priority os wrong.
Comment 1 Bawolff (Brian Wolff) 2011-06-23 03:22:04 UTC
Does $wgOut->addMeta function do what you want? (See http://svn.wikimedia.org/doc/classOutputPage.html#a0b492edfed8cf9eafc32580008e26027 )
Comment 2 Subfader 2011-06-23 11:13:46 UTC
Thanks for the hint. This looks correct to me and returns no error message but also doesn't add the desired tag:

$this->html( 'headelement' );

global $wgOut;
$wgOut->addMeta('description', 'Foo Bar');
Comment 3 Bawolff (Brian Wolff) 2011-06-23 17:22:33 UTC
At which point are you calling that. If its in the skin its probably being called too late (calling $wgOut->addMeta after the meta tags are finalized won't do anything).
Comment 4 Subfader 2011-06-23 19:35:45 UTC
Yep, in the skin (monobook). Somehere above $this->html( 'headelement' ); doesn't do the trick either.

Where else? Can't use it in LocalSettings.php since I want to add the 'catlinks' in the description. Normally I wouldn't care much about the meta tags but it's for Facebook's scraper.
Comment 5 Bawolff (Brian Wolff) 2011-06-23 20:13:51 UTC
Before SkinTemplate::outputPage is called. Which is probably most any hook before skin stuff starts.

OutputPageMakeCategoryLinks seems like the ideal one, since you're passed an OutputPage object, and an array of categories, so no evil globals required.
Comment 6 Subfader 2011-06-23 20:50:01 UTC
Ahhh. So LocalSettings.php is the place to be :) Thanks!
Comment 7 Bawolff (Brian Wolff) 2011-06-23 20:57:06 UTC
I'm going to go ahead and close this bug invalid. Cheers.

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


Navigation
Links