1
我想從索引頁面傳遞一個變量到文章視圖。基本上div的寬度需要根據是否有側邊欄來改變。joomla 3.0從索引到視圖傳遞變量
的index.php:
if ($this->countModules('position-1')&$this->countModules('position-3')){
$content_margin = 'contentCenter';
}elseif ($this->countModules('position-1')&!$this->countModules('position-3')){
$content_margin = 'contentRight';
}elseif (!$this->countModules('position-1')&$this->countModules('position-3')){
$content_margin = 'contentLeft';
}else{
$content_margin = '';
}
我怎麼那麼組件內訪問$ content_margin變量?
<jdoc:include type="component" class="<?php echo $content_margin; ?>" />
我這樣做到底但它需要使用邊界框; '#contentContain { float:left; -moz-box-sizing:border-box; -webkit-box-sizing:border-box; box-sizing:border-box; *行爲:url(/boxsizing.htc); }' – nicky 2013-04-25 22:29:45