Wikipédia:Questions techniques/semaine 6 2021

Performance issue in popular infobox template modifier

Apologies in advance for writing in English.I noticed today that on the featured article Orlaya_grandiflora the text above "Orlaya grandiflora" jumps on a mobile phone cause a layout shift which is bad for performance. This is because Mediawiki:Mobile.css is loaded via JavaScript and because of this we've been trying to discourage use of MediaWiki:Mobile.css in favor of mw:Extension:TemplateStyles for performance reasons (more information provided on mw:Recommendations_for_mobile_friendly_articles_on_Wikimedia_wikis#Do_not_style_infoboxes_in_MediaWiki::Mobile.css). To address this the styles in MediaWiki:Mobile.css need to be moved to Modèle:Taxobox_début and any other templates where they are used. Feel free to ping me if you need any help with doing this. Jdlrobson (discuter) 9 février 2021 à 00:43 (CET)[répondre]

J'ai mis un mot sur : Discussion_Projet:Biologie/Le_café_des_biologistes#Performance issue in popular infobox template => Modèle:Taxobox_début - Drongou (discuter) 10 février 2021 à 01:17 (CET)[répondre]
Et j'ai relancé Discussion_Projet:Scribunto#Chargement_d’un_TemplateStyle_dans_Module:Infobox. Orlodrim (discuter) 10 février 2021 à 01:20 (CET)[répondre]
Effectivement les taxobox utilisent les briques des infobox V3, et ne font rien de spécifique (les classes spécifiées par les taxobox concernent la palette couleur et le style (italiques ou pas) des noms scientifiques). Hexasoft (discuter) 10 février 2021 à 16:44 (CET)[répondre]
  Jdlrobson :
Thanks for reporting. This makes sense but this is an unfortunate situation.
As far as I know, TemplateStyles results in uncacheable CSS (in the sense that it must be served with each page that uses it), so for infobox_v3 styles used in about 25% of pages, having them in a global cacheable CSS would be better overall... if that global CSS were not loaded through JavaScript.
It looks like our effort to keep Mobile.css small compared to Common.css on this wiki are pointless, because it's larger on other wikis, and thus the file has to be loaded in a way that makes it unusable.
Anyway, I guess this is the right thing to do given how things are.
Orlodrim (discuter) 10 février 2021 à 21:19 (CET)[répondre]
mw:Extension:TemplateStyles does not result in cacheable CSS. Could you point me to where you got this information? It will increase the HTML size, but overall this should result in a performance gain given it uses inline CSS.
We recommend using it for exactly the use case you describe here. It is much better for it to be inside the template than MediaWiki:Common.css. For the 75% of pages which don't use it, they will render much faster. For the pages that do they should render just the same.
Apologies, I meant to post the original message under my staff account. I am requesting this change as a Wikimedia staff member with expertise in this area. Jon (WMF) (discuter) 10 février 2021 à 23:02 (CET)[répondre]
  Jon (WMF) :
My point was that the CSS in MediaWiki:Common.css is loaded a spreadsheet that stays in the browser cache and is transferred once in a while, whereas the same piece of CSS coming from templatestyles needs to be transferred with each distinct article that uses it.
Actually, the current cache expiration for https://fr.wikipedia.org/w/load.php?lang=fr&modules=site.styles&only=styles&skin=vector seems to be 300 seconds, which makes my point a bit dubious even for styles used on 25% of pages  .
The good news is that we considered switching to templatestyles last year, and some cleanup has already been done to avoid using the infobox classes in random places. It's going to take a bit of time though.
Orlodrim (discuter) 11 février 2021 à 00:43 (CET)[répondre]
Understood! Yes, you are probably better off shipping in template styles. I'm in a performance training week this week and the facilitator is French loves using this page as example of not what to do :-)!
I understand it may take time. I think for now it wouldn't be a problem if you duplicated the rules in MediaWiki:Mobile.css and MediaWiki:Common.css to limit the fix to the template in question while you clean up the other infobox templates. That would allow you to feel more confident about the change while it would fix the performance issue here for mobile users. Jon (WMF) (discuter) 11 février 2021 à 02:28 (CET)[répondre]

Quelles sont les règles pour faire une page sur une association ? modifier

Article(s) ou modèle(s) concerné(s) :

Questions : Bonjour, mon père et un ami à lui ont une ONG et j’aimerai en faire une page Wikipédia. Je voulais donc savoir quelles sont les règles sur ce sujet et si vous avez des conseils à donner ? Merci d'avance

Message déposé par [Léonce Doulat] le 9 février 2021

Réponse apportée ci-dessous.
Bonjour,
Les critères pour les associations sont WP:NA. En général, mieux vaut modifier des pages existantes et se familier avec Wikipédia avant de se lancer dans la rédaction d'une nouvelle page qui risquerait d'être supprimée. --Shev (discuter) 9 février 2021 à 13:11 (CET)[répondre]

Discussion Projet:SF/Archive 2 modifier

Article(s) ou modèle(s) concerné(s) : Discussion Projet:SF/Archive 2

Questions : Bonjour, à partir de Discussion Projet:SF/Archive 2#Proposition 7, toute la discussion jusqu'à la fin de la page d'archive est en italique.

Comme tout ce précédait la « Proposition 7 » était en écriture « normale », j'ai pensé qu'il y avait un double guillemet à enlever à la « Proposition 7 », sauf que je n’ai trouvé aucun double-guillemet en surnombre. Du coup je sèche : comment faire pour remettre en texte normal toute la fin de cette page d'archive ? Cordialement.

Message déposé par Éric Messel-2 (discuter) le 11 février 2021 à 15:04 (CET)[répondre]

Réponse apportée ci-dessous.
  Éric Messel-2 :Bonjour   Corrigé . le problème vient du fait que les balises "<div>" ne sont pas fermées, il manque les "</div>". Cordialement. Csar62 (discuter) 11 février 2021 à 15:42 (CET)[répondre]
Excellent, merci beaucoup de ton travail rapide et bien fait ! — Éric Messel-2 (discuter) 11 février 2021 à 15:47 (CET)[répondre]

Insérer des modèles dans sa barre d'outils modifier

Article(s) ou modèle(s) concerné(s) : Barre d'outils

Questions :

Bonjour, je souhaiterais savoir comment faire pour mettre ce modèle :

{{Écrit|titre=|éditeur=[[]]|année=|commentaire=}}

dans ma barre d'outils et faire en sorte que lorsque je le mets sur un titre, celui-ci entre pile dans "titre=" ? Plus précisément, je voudrais le mettre plusieurs fois dans ma barre d'outils avec des champs déjà renseignés :

{{Écrit|langue=en|titre=|année=|commentaire=Inédit en France}}
{{Écrit|langue=en|titre=|année=|titre fr=|éditeur fr=[[J'ai lu]], {{Coll|[[Aventures et Passions]]}}|année fr=}}
{{Écrit|langue=en|titre=|année=|titre fr=|éditeur fr=[[Harlequin Enterprises|Harlequin]], {{Coll|[[Les Historiques]]}}|année fr=}}

Si ça pouvait me faire gagner du temps, ce serait génial. Merci d'avance ! Est-ce qu'il existe une page d'aide pour rajouter des modèles dans sa barre d'outils ?

Message déposé par Guil2027 (discuter) le 13 février 2021 à 19:10 (CET)[répondre]

Requête en attente d'une réponse (comment y répondre)