Mobile Gateway/Mobile homepage formatting/da

Hvis forsiden (hjemmesiden) på dit Wikimedia-projekt ikke er blevet formateret til at blive vist på mobile enheder og du er en administrator af det projekt, følg da venligst instruktionerne nedenfor.

Bemærk venligst: Du skal have administratorrettigheder for at redigere hjemmesiden.

Trin 1
Først, beslut hvilket indhold der er passende for mobilhjemmesiden.

Evaluer sidens elementer i skrivebords-versionen (fx "Dagens Billede") ved at spørge:


 * hvor populære er de?
 * bliver de opdateret regelmæssigt?
 * er de egnede til hurtig læsning?
 * vil de kunne indpasses pænt på en mobilskærm?

Når du har besluttet hvilke elementer, der giver mening, fortsæt til trin 2.

Trin 2
Du skal være logget ind og have administratorrettigheder for at gøre følgende. På skrivebordsvisning af hjemmesiden, klik "" og finde de elementer, som du vil inkludere i mobilvisning.

Hvert element, du vil indkludere på den mobile forside, skal identificeres med en id="mf-..." attribut (hvor "..." er et unikt navn, brug venligst noget menneskeligt læsbart). Du kan kalde disse "mf selectors". En måde at gøre dette på er at sætte en div tag rundt det ønskede element og sætte "mf selector" indeni div mærket, ligesom:

Hvad indsættes mellem åbnings og afslutnings div mærkerne? Det vil sandsynligvis være en skabelon for sideelementet, såsom "Dagens billede".

Updating styles
Certain styles are not mobile friendly. For example any css rules which make use of fixed pixel size e.g. width, height, padding. If different style treatment is needed please use the Extension:TemplateStyles or port these styles to MediaWiki:Common.css or MediaWiki:Mobile.css.

Some tips on common problems are addressed @ Making MediaWiki Mobile Friendly.

Klik på "".

Du er nu næsten færdig.

Trin 3
Nu skal du gå til den mobile URL, som typisk er sprogkode.m.projekt.org. Du kan reducere bredden af ​​din computerbrowser for at efterligne en mobil skærm. Hvordan ser siden ud?

Hvis du vil lave ændringer, gå tilbage til trin 2. Bliv ved med at gå fra trin 2 til trin 3, indtil du er tilfreds.

Det var det!

MFSpecialCaseMainPage
When $wgMFSpecialCaseMainPage is enabled (which is disabled by default), it is possible to serve different content to mobile and desktop users. Use of this method is discouraged and deprecated as it only works on the Main Page, is a maintenance burden and should only be used as a stop-gap measure when transitioning your MediaWiki site to a mobile experience.

Hjemmesiderne med hver sprogversion af Wikipedia og alle de andre Wikimedia-projekter er forskellige, så det er umuligt at vise et generelt eksempel. Alligevel, for at give en ide om hvordan dette måske ville se ud på din side, er her den tyske version af Wikipedia: https://de.wikipedia.org/ Hvis du klikker på Vis kilden ("Quelltext anziegen") ved siden af "Lesen", kan du se wikiteksten og ved at bruge din browsers Find-funktion, kig efter tekststrengen "mf-".

I dette tilfælde er div mærket til mf selektorerne en del af større sideobjekter. Kun de, der er bekendte med projektets hjemmeside formatering, vil forstå dette i detaljer.

Gå nu til: https://de.m.wikipedia.org/ Den resulterende mobilside vil være synlig. De dele af indholdet, der svarer til mf selektorer gengives i den mobile visning.

Deprecation steps for wikis using MFSpecialCaseMainPage
MobileFrontend is in the process of deprecating the code relating to main page special casing. If you have a wiki using it you'll want to stop using it immediately. If you have any questions please don't hesitate to use the talk page!

How can I tell if I'm using it?
If your main page contains " " or " " in the HTML markup, you are using it. You can check this by inspecting the HTML for your main page. If this is too technical, you can also check this by copying and pasting the wiki markup into your user namespace and visiting the page in mobile. If there is a visual difference between your main page and the page in your user namespace you are using main page special casing.

E.g. compare https://en.m.wikipedia.org/wiki/User:Jdlrobson/Main_page_formatting_test with the actual main page for English Wikipedia.

What can I do to fix this?
Assuming you do not want to do a big redesign and just want to retain the existing main page design, you can follow this guide.

Copy the main page markup into a sandbox e.g. a sub page of the user namespace. Now switch to mobile mode. Note, the mobile site can be viewed in your desktop browser, so if you can you may want to consider using the wikitext editor of the mobile site.

You'll need the TemplateStyles extension deployed on your wiki. You can see if it's installed on your wiki by visiting Special:Version. If it's not for whatever reason please request it.

Known problems are listed below:

1. Stop using tables

If your main page uses table's in any way, please remove them. There are many tutorials on the web for doing column layouts. Please put "responsive column layout" into your favorite search engine. If this is confusing, you'll probably want to seek help from a CSS expert!

DivTable converter provides a way for you to convert a table HTML to divs. You should aim to put the associated CSS in MediaWiki:Common.css. This act alone should improve your rendering in mobile greatly.

2. Review any inline styles

Search for any instances of styles which make use of the css properties " ", " ", " " or " "

For eksempel: Move these into a TemplateStyle. Use a class and move the css declaration to css. Example CSS: e.g. Example - note the pre tag is only included for example purposes - this should be put into a TemplateStyle.

3. Reskin for mobile

With the above steps applied your page should look no different on a desktop browser, but as you shrink the screen (horizontal width) to under 720px - the threshold you introduced in step 2 the styles should disappear. You'll want to add new styles (outside the media query you introduced in step 3). These styles will apply to mobile devices and will be overridden.

If there is any content in the page that you do not want to render in the mobile skin you should add the class "nomobile". e.g.

4. Apply the new template

Copy and paste the sandbox page into your Main page. Refresh the browser and verify that it works as expected on both mobile and desktop.

5. Make a site request to turn off main page special casing

If your site is now no longer using the special page casing and your site appears in this config:

You'll want to let a Wikimedia site admin know that you are ready for main page special casing to be turned off. File a Phabricator ticket using this link that links to this web page and lists your wiki.

You'll be able to tell when this has been successful if you've been using the  prefixes as suddenly other content will display on your mobile site!

6. Remove any mobile specific ids.

i.e. any instance of the following: These are not necessary any more. Previously these would choose which content to show on mobile, but now you have a new mobile first responsive design and have disabled main they will be ignored.

e.g. This example