Search code examples
htmlmediawikiwikisidebar

Custom Skin: How to get Languages into MediaWiki Sidebar?


I have got a Wiki, with multiple languages, and a custom Skin. My Sidebar is 100% custom-made. I want to get the Language box in there. If someone uses this markup:

[[iwcode:Pagename]]

I want the link and corresponding Language name to pop up in there. How do i get it into my HTML code?

Please help me!

Best regards, Max


Solution

  • Inside your skin class, yuou should have access to the iw links through $this->data['language_urls']. If you want the links in your sidebar, you can just copy the code from the other skins:

        echo "<ul>";
        foreach ( $this->data['language_urls'] as $key => $langLink ) {
            echo $this->makeListItem( $key, $langLink );
        }
        echo "</ul>";