From: Marc A. Pelletier Date: Sun, 3 Apr 2016 07:46:06 +0000 (+0300) Subject: Add root title class to X-Git-Tag: 1.31.0-rc.0~7242 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=123be2804681b04da5b1499fd9e7e951e384852e;p=lhc%2Fweb%2Fwiklou.git Add root title class to This adds a class to the body node of output pages in the form: rootpage-X Where X is the root title of the page. This provides for the use cases in the linked tasks, and allows the numerous existing cases of expensive css selectors using class*='page-X' that are otherwise needed to apply a style to a page and or its subpages. Bug: T123156 Bug: T17075 Change-Id: Ib16e380d97bd7bb55c5b5044a084fefbd039d599 --- diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index dbc84c0d00..5b50cd8d18 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -387,8 +387,9 @@ abstract class Skin extends ContextSource { } $name = Sanitizer::escapeClass( 'page-' . $title->getPrefixedText() ); + $root = Sanitizer::escapeClass( 'rootpage-' . $title->getRootTitle()->getPrefixedText() ); - return "$numeric $type $name"; + return "$numeric $type $name $root"; } /**