Page MenuHomePhabricator

Small Wiki Toolkits: How-to guidelines and/or potential recommendations for Main page customization (adaptive/responsive CSS basics)
Closed, ResolvedPublic

Description

I sometimes find requests in Phab for help with customizing the main page of wikis.
That is unfortunately out of scope for Phab tasks but of course the problem still exists.

Poster at 36C3 which reminded me of this again:

smallwikitoolkitscss.jpg (2×1 px, 1 MB)

Related Objects

Event Timeline

I suggest looking at Frwiki's main page. They overhauled it a couple of years ago, and it's responsive, and I believe (but not sure) it has been checked for accessibility. Here are the links I can find, but I'll ping @Trizek-WMF in case he knows of further links.
https://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Accueil_principal
https://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Refonte_de_2017_de_l%27Accueil_principal_(FAQ)

Aklapper renamed this task from Small Wiki Toolkits: Main page customization (adaptive/responsive CSS basics; Template basics?) to Small Wiki Toolkits: Main page customization (adaptive/responsive CSS basics; any other best practices / recommendations).Feb 25 2020, 11:25 PM
Aklapper renamed this task from Small Wiki Toolkits: Main page customization (adaptive/responsive CSS basics; any other best practices / recommendations) to Small Wiki Toolkits: How-to guidelines and/or potential recommendations for Main page customization (adaptive/responsive CSS basics; Templates?).Feb 26 2020, 12:04 AM
Aklapper triaged this task as Low priority.

I suggest looking at Frwiki's main page.

Thanks Quiddity!
Looking at https://fr.wikipedia.org/w/index.php?title=Wikipédia:Accueil_principal&action=edit with its boxes, and its related CSS defined in https://fr.wikipedia.org/w/index.php?title=MediaWiki:Common.css (search for accueil) it looks like they use a flexbox design.

For T653 a year I also ended up using flex for the boxes on the mediawiki.org frontpage, see the CSS in https://www.mediawiki.org/w/index.php?title=Template%3AMain_page%2Fstyles.css&type=revision&diff=3175861&oldid=3151579

For browser compatibility, see https://caniuse.com/#feat=flexbox
For general info, see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox

For the records, for T653 I initially also looked at grids ( https://caniuse.com/#feat=css-grid ) and don't remember why I decided against it. Not a web designer.

Aklapper renamed this task from Small Wiki Toolkits: How-to guidelines and/or potential recommendations for Main page customization (adaptive/responsive CSS basics; Templates?) to Small Wiki Toolkits: How-to guidelines and/or potential recommendations for Main page customization (adaptive/responsive CSS basics).Mar 2 2020, 3:53 PM
Aklapper updated the task description. (Show Details)

"Templates" part moved into dedicated T246180: Small Wiki Toolkits: How-to guidelines and/or potential recommendations for Templates hence edited task summary / desc.

These two my items are about mobile though. Right now I don't see how they are problems, as folks would end up with MobileFrontend / Minerva rendering anyway.

Aight, Init draft at https://www.mediawiki.org/wiki/User:AKlapper_(WMF)/Sandbox/T241646 in kind-of simple language. Feedback welcome.
TODOs:

  • Who gets interfaceadmin rights when a new wiki is created? If nobody, then how could/would I change my main page?
  • How to disappoincommunicate feedback / support expectations? We're not a generic CSS/HTML support place. Link to Stackoverflow? :P

@Aklapper Looks good! I've a few comments/questions:

@Aklapper Looks good! I've a few comments/questions:

  • For the line "Copy and paste these CSS definitions into the page MediaWiki:Common.css. Make sure that you use specific names (names in the example....", I think it will be helpful to re-iterate that only interface admins will be able to make this change. Also, make it clear what "specific names" here means. Perhaps, they should be rephrased as "unique names"?

Done.

Replaced mainpage with wikifrontpage. Don't think I can get more specific. :)

Added an explicit See [[mw:Special:MyLanguage/Help:TemplateStyles|TemplateStyles]] for more information. as I don't want to duplicate documentation.

Added the sentence The CSS in [[MediaWiki:Common.css]] affects everyone and is executed automatically for both logged-out and logged-in users.

  • Is there an alternative?

There is an alternative via TemplateStyles, covered below.

  • Newbie question - can something be added to the wiki page itself for responsiveness?

I was torn on that one, as I cannot centralize the CSS within the page and did not want to put it inline as <element style="x, y, z">. However you have a point, so I added that to the beginning. See https://www.mediawiki.org/wiki/User:AKlapper_(WMF)/Sandbox/T241646#What_you_can_learn_on_this_page

I don't think it should be. One requires Gerrit, the other one does not.

Only thing left in this task is finding a good location where to move this page. And then link somehow from https://meta.wikimedia.org/wiki/Small_wiki_toolkits

...and I finally realize that we really must rework https://www.mediawiki.org/wiki/User:AKlapper_(WMF)/Sandbox/T241646 and cover TemplateStyles.
TemplateStyles are the way to go. See T228604 or T248416 for more references.

Alright, I rewrote https://www.mediawiki.org/wiki/User:AKlapper_(WMF)/Sandbox/T241646 to use TemplateStyles only and not (ab)use MediaWiki:Common.css.
Review welcome.

Alright, I rewrote https://www.mediawiki.org/wiki/User:AKlapper_(WMF)/Sandbox/T241646 to use TemplateStyles only and not (ab)use MediaWiki:Common.css.
Review welcome.

I think the paragraph about interfaceadmin rights can be removed now that it is not using common.css. I could be wrong about that though. Various wikis will have applied some sort of edit restrictions to their Main_Page (or local language equivalent), but I don't know that there is wiki-farm wide default for the group that is granted the edit rights is. For enwiki (never the best example) the group needed is sysop via transclusion in https://en.wikipedia.org/wiki/Wikipedia:Cascade-protected_items.

I made a few edits to use <syntaxhighlight/> to add some color to the code blocks. I also added a footnote providing a bit more information on why common.css is not a great way to layout Main_Page. Things felt pretty readable and understandable to me after all your work, but I'm probably a better technical reviewer than a clarity reviewer.

@bd808: Yeah I only kept interfaceadmin in there because of the Main_Page. Thanks for your edits, appreciated!