Page MenuHomePhabricator

Do not hardcode message for logo link, make it configurable
Open, LowPublic


  1. The "mainpage" message is described in MessagesXx.php ("Main page", "Hlavní stránka", "Hoofdpagina" etc.) The "mainpage-description" is by default the same.
  2. The logo links to the page defined by "mainpage" message.
  3. The sidebar link to main page can be changed by for instance
    • mainpage-url|mainpage-description

If done so, the logo should link to mainpage-url then and not to mainpage.

The messsage for mainpage link on logo should be configurable then.

Use case:
Incubator uses Main page/cs, Main page/nl etc. instead of "Hlavní stránka", "Hoofdpagina" etc. Easy to configure in sidebar, no way to configure under the logo, so there is inconsistency between those two links then.

Possible solution:
Introduce $wgMainPageMsg?

Version: unspecified
Severity: normal



Event Timeline

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

Also (via bawolff):
should now go to Main page/cs and not to Hlavní strana

So I suppose Title::newMainPage() should be somehow tweaked the way it will allow it.

What I understand is wanted:

*The mainpage message to be a UI message instead of a content message.
*But not to use any of the translations provided for it (by mediawiki), since we only want it to work for Main Pages that actually exist, so we only want translations that we manually make.

The proposed solution
*Make a new global variable to control which message we use for the 'mainpage' system message. Since a wiki could change it to some non-existent message with no automatic translations, it would only work for manual translations as desired.

This seems ugly in the extreme. What happens if another system message needs to be special handled like that. I really don't like this solution, it just seems "wrong".

If we must do something like this, perhaps a new global similar to $wgForceUIMsgAsContentMsg but causes the message to only take manually made edits to the mediawiki namespace into account when the content language does not equal the user language - aka if there is no manual made edits in the mediawiki namespace for the userlanguage, then treated the same as a normal content language message. (Is that even possible in the current message system).

*Sigh*, as an ugly hack, I should mention that the following would do what you want (but is ugly ugly).

Make mainpage _not_ be in $wgForceUIMsgAsContentMsg

make the content of mediawiki:Mainpage be {{int:new-mainpage}}

Then the main page will be the value of the new-mainpage message (either the specific translation for the language [ aka mediawiki:new-mainpage/fr ] or if that doesn't exist the generic one).

saibotrash wrote:

I just had to create those two redirs: and Without the redir the links to the mainpage (logo and menu) had pointed to a dead page for /ku and /ku-arab

That's what happen when adding messages to $wgForceUIMsgAsContentMsg. You may need to create pages for the content too many times.

For the OP problem, just make logo use mainpage-url?

Aklapper lowered the priority of this task from Medium to Low.Mar 25 2015, 4:07 PM