Chào mọi người mình muốn hỏi mọi người về việc tạo thêm Position của Joomla 2.5 Ảnh Demo: Mình muốn tạo thêm 3 cái position giống như trong ảnh demo nhưng mình thử chèn nhưng không được. Mình có đính kèm file index.php mọi người xem giúp hộ mình nhé. THANKS PHP: <?php/**# ot_petshop OT Petshop Template for Joomla 2.5!# author OmegaTheme.com# copyright Copyright(C) 2012 - OmegaTheme.com. All Rights Reserved.# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL# Website: http://omegatheme.com# Technical support: Forum - http://omegatheme.com/forum/**//**------------------------------------------------------------------------* file: index.php 2.5.0 00001, March 2012 12:00:00Z OmegaTheme $* package: OT Petshop Template*------------------------------------------------------------------------*/ //No direct access!defined( '_JEXEC' ) or die( 'Restricted access' ); include_once(JPATH_ROOT . "/templates/" . $this->template . '/lib/layout/tpl.function.php');include_once(JPATH_ROOT . "/templates/" . $this->template . '/lib/layout/splitmodules.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" ><head><jdoc:include type="head" /> </head><body id="ot-body" class="<?php echo $this->params->get('layoutStyle'); ?> <?php echo $this->params->get('layoutType'); ?> <?php if($this->countModules('left')) echo 'hasLeft '; ?><?php if($this->countModules('right')) echo 'hasRight'; ?>"> <div class="ot-wrap"> <div class="ot-wrap-i"> <div id="ot-header" class="ot-header"> <div class="ot-header-i"> <!-- START LOGO AREA --> <?php if($this->countModules('logo')) { ?> <div id="ot-logo" class="ot-logo"> <jdoc:include type="modules" name="logo" style="none" /> </div> <?php } else { ?> <div id="ot-logo" class="ot-logo"> <a href="<?php echo JURI::base() ; ?>" class="logo"></a> </div> <?php } ?> <!-- END LOGO AREA --> <!-- START TOP AREA --> <?php if($this->countModules('top')) { ?> <div id="ot-top" class="ot-top"> <jdoc:include type="modules" name="top" style="xhtml" /> </div> <?php } ?> <!-- END TOP AREA --> <!-- START MAIN MENU AREA --> <?php if($this->countModules('mainmenu')) { ?> <div id="ot-mainmenu" class="ot-mainmenu"> <div id="ot-menu-img"> <img src="<?php echo 'templates/' . $this->template . '/images/' . $this->params->get('layoutStyle') . '/mainmenu-bg.png'; ?>" /> </div> <div class="ot-mainmenu-i"> <jdoc:include type="modules" name="mainmenu" style="none" /> </div> <div class="ot-search-i"> <jdoc:include type="modules" name="search" style="none" /> </div> </div> <?php } ?> <!-- END MAIN MENU AREA --> <!-- START BANNER AREA --> <?php if($this->countModules('banner')) { ?> <div id="ot-banner" class="ot-banner"> <div class="ot-banner-i"> <jdoc:include type="modules" name="banner" style="none" /> </div> </div> <?php } ?> <!-- END BANNER AREA --> <!-- START HEADBOXES --> <?php $positionsHeadContent = array('headbox-1','headbox-2','headbox-3','headbox-4','headbox-5'); $headContents = splitmodules($this,$positionsHeadContent,$this->params->get('CustomWidthHeadBoxes'),$this->params->get('width_headBoxes')); if($headContents) : ?> <?php if($this->countModules('headbox-1 + headbox-2 + headbox-3 + headbox-4 + headbox-5')) {?> <div class="ot-headboxes"> <div class="ot-headboxes-i"> <?php if($this->countModules('headbox-1')) {?> <div class="headbox headbox1<?php echo $headContents['headbox-1']['class']; ?> width<?php echo $headContents['headbox-1']['width']; ?>"> <jdoc:include type="modules" name="headbox-1" style="otrounded" /> </div> <?php } ?> <?php if( $this->countModules('headbox-2')) {?> <div class="headbox headbox2<?php echo $headContents['headbox-2']['class']; ?> width<?php echo $headContents['headbox-2']['width']; ?>"> <jdoc:include type="modules" name="headbox-2" style="otrounded" /> </div> <?php }?> <?php if( $this->countModules('headbox-3')) {?> <div class="headbox headbox3<?php echo $headContents['headbox-3']['class']; ?> width<?php echo $headContents['headbox-3']['width']; ?>"> <jdoc:include type="modules" name="headbox-3" style="otrounded" /> </div> <?php }?> <?php if( $this->countModules('headbox-4')) {?> <div class="headbox headbox4<?php echo $headContents['headbox-4']['class']; ?> width<?php echo $headContents['headbox-4']['width']; ?>"> <jdoc:include type="modules" name="headbox-4" style="otrounded" /> </div> <?php }?> <?php if( $this->countModules('headbox-5')) {?> <div class="headbox headbox5<?php echo $headContents['headbox-5']['class']; ?> width<?php echo $headContents['headbox-5']['width']; ?>"> <jdoc:include type="modules" name="headbox-5" style="otrounded" /> </div> <?php }?> </div> </div> <?php } endif;?> <!-- END HEADBOXES --> </div> </div> <!-- START MAINBODY --> <div class="ot-mainbody"> <?php if($this->params->get('layoutType') == 'content-left-right') { ?> <div class="ot-mainbody-i" id="hmainbody"> <?php if($this->countModules('right')) { ?> <div class="ot-rightcol" id="hrightcol"> <div class="ot-rightcol-i"> <jdoc:include type="modules" name="right" style="otround" /> </div> </div> <?php } ?> <?php if($this->countModules('left')) { ?> <div class="ot-leftcol" id="hleftcol"> <div class="ot-leftcol-i"> <jdoc:include type="modules" name="left" style="otround" /> </div> </div> <?php } ?> <div class="ot-content" id="hcontent"> <div class="ot-content-i"> <div class="ot-fpage"> <jdoc:include type="component" /> </div> </div> </div> </div> <?php } else { ?> <div class="ot-mainbody-i" id="hmainbody"> <?php if($this->countModules('left')) { ?> <div class="ot-leftcol" id="hleftcol"> <div class="ot-leftcol-i"> <jdoc:include type="modules" name="left" style="otround" /> </div> </div> <?php } ?> <?php if($this->countModules('right')) { ?> <div class="ot-rightcol" id="hrightcol"> <div class="ot-rightcol-i"> <jdoc:include type="modules" name="right" style="otround" /> </div> </div> <?php } ?> <div class="ot-content" id="hcontent"> <div class="ot-content-i" id="hcontent-i"> <div class="ot-fpage"> <jdoc:include type="component" /> </div> </div> </div> </div> <?php } ?> </div> </div> <!-- END MAINBODY --> <div class="ot-footer"> <div class="ot-footer-i"> <jdoc:include type="modules" name="footer" style="xhtml" /> </div> </div> </div> </div> <div style="clear: both;"><jdoc:include type="modules" name="debug" /></div></body></html>
Cám ơn bạn đã giúp mình. Mình có thử chèn trong cả file php và xml nhưng đều không hiện. Mình cũng chưa rõ câu lệnh code của template joomla 2.5 để chèn vào file php có giống 1.5 hay không. mình có đính kèm file index.php lên để các bạn trợ giúp. Bạn có thể chia sẻ cho mình đoạn code tạo ra 3 vị trí như trong ảnh để chèn vào file index.php được không. File Xml mình có thể làm được. THANKS
giống . jl1.5->3 thì cách add module vị trí như nhau cả. chỉ cần add position trong xml và include module trong index.php thôi. ở trong admin bạn xem thử module bạn add vào đúng vị trí và gán đúng menu đó chưa .
Mình cũng đã thử kiểm tra trong Admin phần Module lúc add đã gán đúng nhưng vẫn không hiện. Hiện tại thỳ mình đã chuyển về mặc định như ban đầu. Mình muốn chèn thêm 3 vị trí nữa là Top, Content, Button trong đoạn code sau: PHP: <!-- START MAINBODY --> <div class="ot-mainbody"> <?php if($this->params->get('layoutType') == 'content-left-right') { ?> <div class="ot-mainbody-i" id="hmainbody"> <?php if($this->countModules('right')) { ?> <div class="ot-rightcol" id="hrightcol"> <div class="ot-rightcol-i"> <jdoc:include type="modules" name="right" style="otround" /> </div> </div> <?php } ?> <?php if($this->countModules('left')) { ?> <div class="ot-leftcol" id="hleftcol"> <div class="ot-leftcol-i"> <jdoc:include type="modules" name="left" style="otround" /> </div> </div> <?php } ?> <div class="ot-content" id="hcontent"> <div class="ot-content-i"> <div class="ot-fpage"> <jdoc:include type="component" /> </div> </div> </div> </div> <?php } else { ?> <div class="ot-mainbody-i" id="hmainbody"> <?php if($this->countModules('left')) { ?> <div class="ot-leftcol" id="hleftcol"> <div class="ot-leftcol-i"> <jdoc:include type="modules" name="left" style="otround" /> </div> </div> <?php } ?> <?php if($this->countModules('right')) { ?> <div class="ot-rightcol" id="hrightcol"> <div class="ot-rightcol-i"> <jdoc:include type="modules" name="right" style="otround" /> </div> </div> <?php } ?> <div class="ot-content" id="hcontent"> <div class="ot-content-i" id="hcontent-i"> <div class="ot-fpage"> <jdoc:include type="component" /> </div> </div> </div> </div> <?php } ?> </div> </div> <!-- END MAINBODY -->
add nthoa87@yahoo cho dễ nói đi. làm biếng lên đây check. dạo này ít lên . mà ở giua trong hình là content phải ko . bạn edit com-content cho nó load module ở trong luôn đi
<div id="newsflash"> <?php if (mosCountModules('advert1')) { ?> <div id="advert1" style="width:<?php echo $topswidth; ?>;"><?php mosLoadModules('advert1',-2);?></div><?php } ?> <?php if (mosCountModules('advert2')) { ?> <div id="advert2" style="width:<?php echo $topswidth; ?>;"><?php mosLoadModules('advert2',-2);?></div><?php } ?> </div><?php } ?> Em có đoạn code trong file index.php, chỗ $topswidth em không hiểu, xin mọi người giúp đỡ. Thanks