User:AKlapper (WMF)/Sandbox/T241646

When you are a member of a new wiki community, you sometimes want to customize the main page (to make it look better on small screens), or change configuration settings.

This page explains some basics, so you can make these changes yourself. You will have to read a bit, might learn something new, and have to test yourself.

Performing the steps below requires interfaceadmin rights. You can find a list of users with interfaceadmin rights by going to Special:ListUsers/interface-admin on your wiki. After a new wiki is created, by default nobody has interfaceadmin rights. Sometimes people are made admins on the basis of a steward decision, but usually only when the new wiki community had made a local request for adminship. Interfaceadmin rights are only given to people who specifically request it.

What you can learn on this page
Change the width of your browser window. Make it smaller and wider. See how arrangement of the boxes in the next line changes:

 Box 1 Box 2 Box 3 Box 4 Box 5

This page explains how you can have this on your wiki.

Understand the background
Somehow, boxes are popular in web layout nowadays. If you put some boxes next to each other, then you also want these boxes to be readable on small screens. This is called responsive web design.

To put boxes next to each other, some people (ab)used tables in the past. Tables exist in wiki markup, but tables are a bad idea. Tables look bad on small screens (see this example image) and can create accessibility problems.

Unfortunately, the MediaWiki software does not provide responsive boxes as wiki markup. (Some boxes might exist as templates on some wikis, though.) And using  to store the layout ("CSS") for one single page is also a bad idea.

Hence on this page, we will
 * use HTML markup and wiki markup for the actual content on the page
 * save this content as a template in a new wiki page called
 * use CSS to define the layout part (boxes) in a new wiki page called
 * use TemplateStyles to apply the layout to the content in the template via the line, and
 * on the mainpage, load and embed the template via the line.

Define the CSS
The next lines define the layout of a box, and at which width a box moves from one line to the next line. You do not have to understand all the CSS below.

.wikifrontpage_row { display: flex; flex-direction: row; flex-flow: row wrap; justify-content: space-between; padding: 0; margin: 0 -5px 0 -5px; } .wikifrontpage_box { flex: 1; margin: 5px; min-width: 240px; border: 1px solid #CCC; padding: 0 10px 10px 10px; box-shadow: 0 2px 2px rgba(0,0,0,0.1); }

The important parts in the CSS above are all lines with the word  (which defines a flexible layout) and the line   (which defines the width when to move a box from the same line to the next line).

Copy and paste these CSS definitions into the page MediaWiki:Common.css. As written above, this requires interfaceadmin rights. Make sure that you use unique, specific names (names in the example above are  and  ), as all the CSS on the MediaWiki:Common.css is applied on all and any pages on your wiki. The CSS in MediaWiki:Common.css affects everyone and is executed automatically for both logged-out and logged-in users.

Edit the content of the main page
Here is a skeleton with five boxes that you could copy and paste, and then adjust. It uses the HTML division element ("div"). The  parameter loads the CSS which we defined for that class name in the previous step. You can of course change the number of boxes: To remove a box, remove everything between an opening  and its corresponding closing. Make sure that these two elements match, otherwise weird stuff can happen.

 

Box 1

 * Item1 in the first box
 * Item2 text in the first box

Box 2
Some text in the second box 

Box 3
Some text in the third box 

Box 4
Some text in the fourth box 

Box 5
Some text in the fifth box

Test

 * Use the "Show preview" button. Either resize the window of your web browser to see how the page looks on smaller screens, or use the Developer Tools of your browser to make the viewport smaller. (For more information, see: Chrome/Chromium, Firefox, Internet Explorer, Opera, Safari).
 * Make sure to also test your changes with all the other skins available in the Preferences under "Appearance"!

Publish
If you are content with the changes, save them.

Problems

 * Clear your browser cache if you cannot see your changes.
 * If you have image thumbnails above your area with boxes, and you do not want a thumbnail to decrease the width of the area with boxes, add a HTML division element with the CSS clear property before the boxes area:
 * Questions? Feel free to bring up any questions on meta:Special:MyLanguage/Tech or other technical support places. Please do not ask on the Discussion page here.

Other CSS options for smaller screens
Another option is to define CSS rules which are only used up to some window width. See CSS media queries if you are interested in experimenting with that.

Further CSS loading options in MediaWiki

 * Advanced: You could also load the main page as a template, and add put the CSS into a separate page and load that separate page via TemplateStyles, e.g. . See TemplateStyles for more information.

Other customization changes
See Wikimedia site requests how you can:
 * change the logo of a Wikimedia wiki,
 * add a custom namespace,
 * change the translation of a namespace,
 * change the linktrail,
 * change local group rights,
 * change user groups and restriction levels,
 * enable or disable extensions on a wiki,
 * change import sources,
 * convert digits (numbers) into a different script,
 * etc.