Bonjour,
J'essaye d'appliquer les bonnes pratiques d'intégration recommandés dans boilerplate à un site fait en SPIP+Z, en particulier en ajoutant des classes conditionnelles pour IE (oui, encore lui) sur la balise body, ou plutôt html.
J'ai donc copié ce fichier structure.html :
http://zone.spip.org/trac/spip-zone/browser/tags/zpip-1.7.12/structure.html
qui est modifié ainsi à cause de la syntaxe à crochets des commentaires conditionnels qui vient casser les crochets-parenthèses de SPIP, mais je me demande comment mieux faire :
<?php if (!_request('var_zajax')) { ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Cf.: http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html dir="#LANG_DIR" lang="#LANG" xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" class="[(#LANG_DIR)][ (#LANG)] no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html dir="#LANG_DIR" lang="#LANG" xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" class="[(#LANG_DIR)][ (#LANG)] no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html dir="#LANG_DIR" lang="#LANG" xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" class="[(#LANG_DIR)][ (#LANG)] no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html dir="#LANG_DIR" lang="#LANG" xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" class="[(#LANG_DIR)][ (#LANG)] no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html dir="#LANG_DIR" lang="#LANG" xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" class="[(#LANG_DIR)][ (#LANG)] no-js"> <!--<![endif]-->
<head>
<INCLURE{fond=head/#ENV{type},env}>
<INCLURE{fond=inclure/head}>
</head>
<body class="page_#ENV{type,page}[ #ENV{type,page}_(#ENV{composition,''})]">
<INCLURE{fond=body,env}>
#SPIP_CRON
</body>
</html>
<?php } else { ?>
<INCLURE{fond=#VAL{var_zajax}|_request|concat{'/',#ENV{type}},env}>
<?php } ?>
C'est pas top mal d'utiliser du php de la sorte ? Pour éviter ça, ne vaut-il pas mieux déporter la balise html et ses commentaires conditionnels dans un inclure, pour maintenir les crochets-parenthèses de SPIP ?