Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1036683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:44:41+00:00 2026-05-16T14:44:41+00:00

I’m setting up a bunch of different language mediawiki’s on one codebase. So far

  • 0

I’m setting up a bunch of different language mediawiki’s on one codebase. So far most of it is working, but I want to use a main page that looks different than the rest of the pages. To do this I originally just added some css rules that only applied to the main_page class:

body .page-Main_Page { <rules> }

The problem is that in other languages the main page is called differently (and the class changes accordingly), so I either have to add css rules for all possible main page titles (not gonna happen) or do a check inside the skin that adds a class to the body if the current page is the main page.

Unfortunately, there’s no way to check that. Most solutions I’ve googled are based on either ‘Main Page’ or setting your own title. I want the skin to detect the title automatically.

The only solution I´ve thought of so far is take mediawiki´s variable for the main page url and compare it to the current page title:

$mainurl = $this->data['nav_urls']['mainpage']['href'];
$ismain = $this->data['thispage'] == substr($mainurl,'6');

(the [‘href’] starts with /wiki/, hence the offset of 6)

and later

<body class="<?php echo ($ismain ? 'mainpage' : ''); ?>">    

(and some more classes of course, but you get the idea)

But this gives me another problem. In spanish, the page is called Página Principal. The data[‘thispage’] has no problems with that, but the [‘href’] is saved as /wiki/P%C3%A1gina_Principal

So… can anyone either tell me how to
1. lookup the translation for ‘Main Page’ in the language that is currently used OR
2. convert P%C3%A1gina_Principal into Página Principal (and the like for other languages) OR
3. show me another way to check if I’m on the main page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:44:41+00:00Added an answer on May 16, 2026 at 2:44 pm

    Haha omg, it was so simple.

    $this->data['skin']->mTitle->mUrlform == $mainurl;
    

    Well that proves once again that typing out your problem to someone else can sometimes give you just the insight you needed.. 😛

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.