Kipcool has submitted this change and it was merged.
Change subject: remove Expression: from title, only in view mode
......................................................................
remove Expression: from title, only in view mode
Change-Id: I031bfaa313e117d5a4af4c3b4b8cc49db4ed469f
---
M Wikidata.hooks.php
1 file changed, 10 insertions(+), 6 deletions(-)
Approvals:
Kipcool: Verified; Looks good to me, approved
diff --git a/Wikidata.hooks.php b/Wikidata.hooks.php
index d20b4a2..9ad0f2a 100644
--- a/Wikidata.hooks.php
+++ b/Wikidata.hooks.php
@@ -7,6 +7,8 @@
public static function onBeforePageDisplay( $out, $skin ) {
global $wgContLang;
+ $request = $out->getRequest();
+
$out->addModules( 'ext.Wikidata.css' );
$out->addModules( 'ext.Wikidata.ajax' );
@@ -15,13 +17,15 @@
$out->addModules( 'ext.Wikidata.suggest' );
// remove Expression: from title. Looks better on Google
- $namespace = $skin->getTitle()->getNamespace();
- if ( $namespace == NS_EXPRESSION ) {
- $namespaceText = $wgContLang->getNsText( $namespace );
- // cut the namespaceText from the title
- $out->setPageTitle( mb_substr( $out->getPageTitle(),
mb_strlen( $namespaceText ) + 1 ) );
+ $action = $request->getText( "action", "view" );
+ if ( $action=='view') {
+ $namespace = $skin->getTitle()->getNamespace();
+ if ( $namespace == NS_EXPRESSION ) {
+ $namespaceText = $wgContLang->getNsText(
$namespace );
+ // cut the namespaceText from the title
+ $out->setPageTitle( mb_substr(
$out->getPageTitle(), mb_strlen( $namespaceText ) + 1 ) );
+ }
}
-
return true;
}
--
To view, visit https://gerrit.wikimedia.org/r/90711
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I031bfaa313e117d5a4af4c3b4b8cc49db4ed469f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Kipcool <[email protected]>
Gerrit-Reviewer: Kipcool <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits