Thêm vị trí module cho joomla 15 Mở file chứa template của bạn chẳng hạn "\templates\ten-template\index.php", xác định chỗ mà bạn muốn thêm một vị trí module mới và đặt vào đoạn mã sau:
Trang 1Thêm vị trí module cho joomla 15
Mở file chứa template của bạn chẳng hạn
"\templates\ten-template\index.php", xác định chỗ mà bạn muốn thêm một vị trí module mới và đặt vào đoạn mã sau:
<?php if ($this->countModules('vitri')) : ?>
<div>
<jdoc:include type="modules" name="vitri" style="xhtml" />
</div>
<?php endif; ?>
Tiếp theo, mở file "\templates\ten-template\templateDetails.xml", thêm vào mục <positions></positions> đoạn mã sau:
<position>vitri</position>
Trong đó thuộc tính "style" có thể là: rounded, none, table, horz, xhtml, outline
TẠO NHIỀU VỊ TRÍ TRÊN CÙNG 1 DÒNG:
Trang 2<! Vị trí mới >
<?php
$spotlight = array ('vt1','vt2');
$vitri = $tmpTools->calSpotlight ($spotlight, 99.5);
if( $vitri ) {
?>
<! Tạo vị trí 1 >
<?php if( $this->CountModules('vt1') ) {?>
<div style="width: <?php echo $vitri['vt1']['width']; ?>;">
<jdoc:include style="xhtml" />
</div>
<! hết vị trí 1 >
<! Tạo vị trí 2 >
Trang 3<?php } ?>
<?php if( $this->CountModules('vt2') ) {?>
<div style="width: <?php echo $vitri['vt2']['width']; ?>;">
<jdoc:include style="xhtml" />
</div>
<?php } ?>
<! hết vị trí 2 >
<?php } ?>
<! Hết vị trí mới >
Tiếp theo, mở file "\templates\ten-template\templateDetails.xml", thêm
giữa 2 thẻ: <positions> </positions> đoạn mã sau:
<position>vt1</position>
Trang 4<position>vt2</position>
Muốn thêm bao nhiêu vị trí thì thêm bấy nhiêu
Lúc này các vị trí: vt1 và vt2 nằm trên cùng 1 dòng