Kaldari has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/403913 )
Change subject: Allow loading custom CSS for the landing page
......................................................................
Allow loading custom CSS for the landing page
Currently, the community is trying to customize the look of the page
with {{hidden title}} which ends up just looking awkward and doesn't
remove other unneeded parts of the page like the subheader and the
categories.
See https://en.wikipedia.org/wiki/Wikipedia:New_user_landing_page.
Change-Id: I61c6fb9e3561f5a261fa5d1348e7df4299488fef
---
M extension.json
A includes/CustomStyles.php
M includes/Hooks.php
A modules/ext.acw.landingPage.css
4 files changed, 39 insertions(+), 0 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticleCreationWorkflow
refs/changes/13/403913/1
diff --git a/extension.json b/extension.json
index 4c3b73f..ec0fb15 100644
--- a/extension.json
+++ b/extension.json
@@ -32,6 +32,11 @@
"scripts": [
"ext.acw.eventlogging.js"
]
+ },
+ "ext.acw.landingPageStyles": {
+ "styles": [
+ "ext.acw.landingPage.css"
+ ]
}
},
"config": {
@@ -51,6 +56,10 @@
}
},
"merge_strategy": "array_plus_2d"
+ },
+ "UseCustomLandingPageStyles": {
+ "description": "Whether to load custom CSS for the
landing page",
+ "value": true
}
},
"ConfigRegistry": {
diff --git a/includes/CustomStyles.php b/includes/CustomStyles.php
new file mode 100644
index 0000000..342f222
--- /dev/null
+++ b/includes/CustomStyles.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Custom ResourceLoader module that loads on-wiki CSS allowing customization
of the landing page
+ */
+
+namespace ArticleCreationWorkflow;
+use ResourceLoaderWikiModule;
+use ResourceLoaderContext;
+
+class CustomStyles extends ResourceLoaderWikiModule {
+
+ /**
+ * @param ResourceLoaderContext $context
+ * @return array
+ */
+ protected function getPages( ResourceLoaderContext $context ) {
+ return [
+ 'MediaWiki:ArticleCreationLandingPage.css' => [ 'type'
=> 'style' ],
+ ];
+ }
+}
diff --git a/includes/Hooks.php b/includes/Hooks.php
index d9f79fa..1c2fcbe 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -79,6 +79,9 @@
->makeConfig( 'ArticleCreationWorkflow' );
$workflow = new Workflow( $config );
if ( $out->getPageTitle() == $workflow->getLandingPageTitle() )
{
+ if ( $config->get( 'UseCustomLandingPageStyles' ) ) {
+ $out->addModuleStyles (
'ext.acw.landingPageStyles' );
+ }
$out->addModules( 'ext.acw.eventlogging' );
}
}
diff --git a/modules/ext.acw.landingPage.css b/modules/ext.acw.landingPage.css
new file mode 100644
index 0000000..1c0eb12
--- /dev/null
+++ b/modules/ext.acw.landingPage.css
@@ -0,0 +1,6 @@
+/*
+ * Hide unneeded page elements.
+ */
+#firstHeading, #siteSub, #catlinks {
+ display: none !important;
+}
--
To view, visit https://gerrit.wikimedia.org/r/403913
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I61c6fb9e3561f5a261fa5d1348e7df4299488fef
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleCreationWorkflow
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits