我是剛安裝的使用者,之前使用JOOMLA。 想問的是想功能提供讓管理者可直接看到模版區塊嗎? 還有我該如何自己加區塊,如要自己加那程式碼該如何加且該修改哪個程式碼檔案?
修改sites\all\themes\yourtheme\template.php 例如要新增一個top menu的區塊
<?php function yorutheme_regions() { return array( 'top_menu' => t('top menu'), 'left' => t('left sidebar'), 'right' => t('right sidebar'), 'content' => t('content'), 'header' => t('header'), 'footer' => t('footer') );}?>
<?php if ($top_menu) { ?> <?php print $top_menu ; ?> <?php } ?> 以上我所知道的 如果有誤 歡迎指正
<?php if ($top_menu) { ?>
<?php print $top_menu ; ?>
<?php } ?>
以上我所知道的 如果有誤 歡迎指正
Re:
修改sites\all\themes\yourtheme\template.php
例如要新增一個top menu的區塊
<?phpfunction yorutheme_regions() {
return array(
'top_menu' => t('top menu'),
'left' => t('left sidebar'),
'right' => t('right sidebar'),
'content' => t('content'),
'header' => t('header'),
'footer' => t('footer')
);
}
?>
接著編輯page.tpl.php 在適當位置加入
<?phpif ($top_menu) {
?>
<?phpprint $top_menu ;
?>
<?php}
?>
以上我所知道的 如果有誤 歡迎指正