Wikimedia

It should be possible to turn lead paragraph on in other namespaces

This task is about the MobileFrontend extension.

It should be possible to configure the lead paragraph transform to namespaces other than main. In particular, this is important for ensuring articles in the draft namespace are consistent with those in main

Original report

On Dutch wikipedia there was a discussion on https://nl.wikipedia.org/wiki/Help:Helpdesk#Plaatsing_infobox (Dutch) about how the mobile website displays the infobox. It was concluded the infobox is indeed placed at the first empty line, that was confirmed by Krinkle. However, on the 'Kladblok' (Dutch for draft) this didn't happen, confusing the editor first.

Will it be possible to make the behaviour the same?

Acceptance criteria

  • A config flag exists that allows turning on the LeadParagraphTransform in multiple namespaces rather than main in various namespaces.
  • The config flag defaults to [ 0 ].

Developer notes

Inside includes/MobileFrontend.body.php the logic for showing a lead paragraph is like so:

showFirstParagraphBeforeInfobox = $ns === NS_MAIN &&
                        $featureManager->isFeatureAvailableInContext( 'MFShowFirstParagraphBeforeInfobox', $context ),

Instead of doing this there should be a config flag do this:

showFirstParagraphBeforeInfobox = $this->isLeadParagraphEnabledInNamespace( $ns ) &&
                        $featureManager->isFeatureAvailableInContext( 'MFShowFirstParagraphBeforeInfobox', $context ),

Task tags

  • php

Students who completed this task

BrandonXLF

Task type

  • code Code
close

2019