mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-24 00:05:50 +00:00
Merge "Configure footer and sidebar placements" into dev
This commit is contained in:
commit
21db191b34
|
@ -97,8 +97,8 @@
|
|||
}
|
||||
},
|
||||
"config": {
|
||||
"@RelatedArticlesShowReadMore": "If true, shows ReadMore while hiding related articles from the sidebar on desktop.",
|
||||
"RelatedArticlesShowReadMore": false,
|
||||
"RelatedArticlesShowInSidebar": true,
|
||||
"RelatedArticlesShowInFooter": false,
|
||||
"RelatedArticlesUseCirrusSearch": false,
|
||||
"RelatedArticlesOnlyUseCirrusSearch": false,
|
||||
"RelatedArticlesLoggingSamplingRate": 0.01
|
||||
|
|
|
@ -40,10 +40,10 @@ class FooterHooks {
|
|||
* to the output when:
|
||||
*
|
||||
* <ol>
|
||||
* <li><code>$wgRelatedArticlesShowReadMore</code> is truthy</li>
|
||||
* <li><code>$wgRelatedArticlesShowInFooter</code> is truthy</li>
|
||||
* <li>On mobile, the output is being rendered with
|
||||
* <code>SkinMinervaBeta<code></li>
|
||||
* <li>On desktop, the beta feature has been enabled.</li>
|
||||
* <li>On desktop, the beta feature has been enabled</li>
|
||||
* <li>The page is in mainspace</li>
|
||||
* </ol>
|
||||
*
|
||||
|
@ -53,7 +53,7 @@ class FooterHooks {
|
|||
*/
|
||||
public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
|
||||
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'RelatedArticles' );
|
||||
$showReadMore = $config->get( 'RelatedArticlesShowReadMore' );
|
||||
$showReadMore = $config->get( 'RelatedArticlesShowInFooter' );
|
||||
|
||||
$title = $out->getContext()->getTitle();
|
||||
|
||||
|
@ -170,7 +170,7 @@ class FooterHooks {
|
|||
*/
|
||||
public static function onGetBetaFeaturePreferences( User $user, array &$preferences ) {
|
||||
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'RelatedArticles' );
|
||||
$showReadMore = $config->get( 'RelatedArticlesShowReadMore' );
|
||||
$showReadMore = $config->get( 'RelatedArticlesShowInFooter' );
|
||||
|
||||
if ( $showReadMore ) {
|
||||
$wgExtensionAssetsPath = $config->get( 'ExtensionAssetsPath' );
|
||||
|
|
|
@ -157,7 +157,7 @@ class SidebarHooks {
|
|||
private static function isInSidebar( $relatedPages, User $user ) {
|
||||
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'RelatedArticles' );
|
||||
|
||||
if ( !$relatedPages || $config->get( 'RelatedArticlesShowReadMore' ) ) {
|
||||
if ( !$relatedPages || !$config->get( 'RelatedArticlesShowInSidebar' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue