Last modified: 2012-12-16 16:58:07 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 T33258, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31258 - Implement a way to set the document title properly
Implement a way to set the document title properly
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
unspecified
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-29 23:19 UTC by Krinkle
Modified: 2012-12-16 16:58 UTC (History)
3 users (show)

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


Attachments

Description Krinkle 2011-09-29 23:19:54 UTC
Suggesting the page.startup module gets a method like OutputPage's setPageTitle and setPageTitleActionText.

The code to do it properly is fairly tedious, centralizing will make sure it's done right and without hassle.

It should use the message key 'pagetitle' (making sure to globally replace {{SITENAME}} with wgSiteName and pass the input as first message param).

If a prefixed action text is used, separation should be done with ' - '.
Comment 1 Brion Vibber 2011-09-30 18:05:27 UTC
What sort of circumstances involve changing the page title in JS currently or envisioned?
Comment 2 Mark Holmquist 2012-12-16 06:52:53 UTC
I pointed someone to this bug without thoroughly reviewing the necessary tasks, I think it's safe to say it's not actually easy because it involves building a totally new JS library that mimicks existing PHP behaviour.

If we'd like to re-add the easy tag after the idea is more fleshed out, that should be OK.
Comment 3 Krinkle 2012-12-16 16:57:28 UTC
(In reply to comment #2)
> I think it's safe to say it's not actually easy because it involves
> building a totally new JS library that mimicks existing PHP behaviour.

Uh.. what library?

This is just a new method on mw.page that would:
* Set document.title to mw.msg 'pagetitle' (supporting SITENAME and $1)
* Updating firstHeading (usually <h1) text

Anything else?

(In reply to comment #1)
> What sort of circumstances involve changing the page title in JS currently or
> envisioned?

Nothing yet in core, but I noticed some scripts and gadgets re-inventing this over and over and since it is core that knows/decides where and how the title is handled, it is best maintained in core.
Comment 4 Krinkle 2012-12-16 16:58:07 UTC
But I agree, we don't need this on the short term. Not sure if would even be merged if patches/proposed right now.

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


Navigation
Links