﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking
2458	IDs und Klassen auf body-Level zur Vereinfachung von Selektoren für CSS	noRiddle	Markus Rehm	"Wie ich vor einiger Zeit an diversen Stellen im Forum bereits vorgeschlagen habe wären IDs und Klassen auf body-Level sinnvoll, um Selektoren auf Seiten-Level zu erhalten mit welchen man besser bestimmte Bereiche ansprechen kann.

Beispiel für die ''/includes/header.php'':
{{{#!php
<?php

$PATH_ID = '';
$PATH_CLASS = '';
$ID_PATH_ID = '';
$CLASS_PATH_CLASS = '';
if (strpos($PHP_SELF, 'index') && !isset($_GET['cPath']) && !isset($_GET['manufacturers_id'])) {
    $PATH_CLASS = 'start';
    //$PATH_ID = 'start';
} elseif (isset($_GET['cPath'])) {
    $cP = preg_replace(""#[^0-9_]#"", '', $_GET['cPath']);
    $PATH_CLASS = 'cat';
    $PATH_ID = 'cat-'.$cP;
} elseif (isset($_GET['manufacturers_id']) && !strpos($PHP_SELF, 'search_result')) {
    $mID = (int)$_GET['manufacturers_id'];
    $PATH_CLASS = 'man';
    $PATH_ID = 'man-'.$mID;
} elseif (strpos($PHP_SELF, 'product_info')) {
    $pID = (int)$_GET['products_id'];
    $PATH_CLASS = 'prod';
    $PATH_ID = 'prod-'.$pID;
} elseif (strpos($PHP_SELF, 'search_result')) {
    $sr = 'sr';
    $PATH_CLASS = $sr;
    //$PATH_ID = $sr;
} elseif (isset($_GET['coID'])) {
    $coID = (int)$_GET['coID'];
    $PATH_CLASS = 'cont';
    $PATH_ID = 'cont-'.$coID;
} elseif (strpos($PHP_SELF, 'account')) {
    $PATH_CLASS = 'acco';
} elseif (strpos($PHP_SELF, 'shopping')) {
    $PATH_CLASS = 'shopp';
} elseif (strpos($PHP_SELF, 'checkout_shipping')) {
    $PATH_CLASS = 'ch-shipp';
} elseif (strpos($PHP_SELF, 'checkout_payment')) {
    $PATH_CLASS = 'ch-pay';
} elseif (strpos($PHP_SELF, 'checkout_confirmation')) {
    $PATH_CLASS = 'ch-conf';
}

$ID_PATH_ID = $PATH_ID != '' ? ' id=""'.$PATH_ID.'""' : '';
$CLASS_PATH_CLASS = $PATH_CLASS != '' ? ' class=""'.$PATH_CLASS.'""' : '';
?>
<body<?php echo $ID_PATH_ID . $PATH_CLASS; ?>>
}}}

Damit kann man dann beispielsweise generell Kategorieseiten ansprechen
{{{#!css
.cat SUBSELECTOR {
  background:#XXX
}
}}}

oder explizit
{{{#!css
.cat-1_3 SUBSELECTOR {
  background:#YYY
}
}}}

oder die Startseite
{{{#!css
.start SUBSELECTOR {
  background:#ZZZ
}
}}}

oder...


Gruß,
noRiddle
"	Neues Feature	closed	normal	modified-shop-2.0.8.0	Shop	2.0.7.2	fixed				
