From 123be2804681b04da5b1499fd9e7e951e384852e Mon Sep 17 00:00:00 2001 From: "Marc A. Pelletier" Date: Sun, 3 Apr 2016 10:46:06 +0300 Subject: [PATCH] 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 --- includes/skins/Skin.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"; } /** -- 2.20.1