How to change to different css for Itemid?
ちょっとJoomla!の覚書。
itemidを判断してCSSを読み分けする。これって良く使うくせに直ぐ忘れて作り直す。。。
<?php $itemA = array(101,116,118,139,140); $itemB = array(103,117,124,125,136,137,138,141); $app = JFactory::getApplication(); $itemid = $app->input->getCmd('Itemid', ''); if (in_array($itemid, $itemA)) { //style A echo '<link rel="stylesheet" href="/css/diff_a.css" type="text/css" charset="utf-8" />' ; }elseif(in_array($itemid, $itemB)){ //style B echo '<link rel="stylesheet" href="/css/diff_b.css" type="text/css" charset="utf-8" />' ; }else{ //style C echo '<link rel="stylesheet" href="/css/diff_c.css" type="text/css" charset="utf-8" />' ; } ?>