Pages

Jumat, 24 Agustus 2012

Menambahkan Module Position baru pada template Joomla

Buat Anda yang baru mengenal Joomla, tips berikut ini mungkin akan berguna.
Pertama-tama untuk melihat module position yang tersedia pada template Anda, gunakan url: http://www.situsanda.com/index.php?tp=1

Tambahkan kode berikut pada index.php di folder /template/ dimana Anda mau menempatkan
posisi modul baru Anda. Oh ya nyisipinnya dimana itu terserah anda, trial error aja yah
:)

Joomla! 1.0


<?php if (mosCountModules('custom')>0) { ?>
<?php mosLoadModules('custom',-2); ?>
<?php } ?>

Joomla! 1.5

<?php if ($this->countModules('custom')) : ?>
<div>
<jdoc:include type="modules" name="custom" style="xhtml" />
</div>
<?php endif; ?>

Ganti nama(custom) dengan apapun yang Anda suka.
Kalo langkah2 udah bener, bakalan muncul tuh module position baru
Contoh :

<?php
/*
*  (C) 2009 - 2011 SiteGround.com - All Rights Reserved.
*  General Public License version 3 or later; see LICENSE.txt

*This program is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.

*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.

*  You should have received a copy of the GNU General Public License
*  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

defined( '_JEXEC' ) or die( 'Restricted access' );
JPlugin::loadLanguage( 'tpl_SG1' );
?>
<!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" />
<link rel="stylesheet" href="templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
</head>
<body id="page_bg">
<div id="wrapper">
<div id="header">
<div id="top">
<div id="logo"><h1><a href="index.php"><?php echo $mainframe->getCfg('sitename') ;?></a></h1></div>
<div id="pillmenu">
<jdoc:include type="modules" name="user3" />
</div>
<div></div>
</div>
<div id="newsflash">
<div>
<jdoc:include type="modules" style="rounded" name="user2" />
</div>
<div>
<jdoc:include type="modules" style="rounded" name="top" />
</div>
<div></div>
</div>
<div>
<jdoc:include type="module" name="breadcrumbs" />
</div>

<div></div>
<div id="search">
<jdoc:include type="modules" name="user4" />
</div>
</div>

<?php if($this->countModules('left') and $this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
<div id="content">
<?php elseif($this->countModules('left') and !$this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
<div id="content">
<?php elseif(!$this->countModules('left') and $this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
<div id="content">
<?php else: ?>
<div id="content">
<?php endif; ?>

<?php if($this->countModules('left') and JRequest::getCmd('layout') != 'form') : ?>
<div id="leftcolumn">
<jdoc:include type="modules" name="left" style="rounded" />
<?php $sg = 'banner'; include "templates.php"; ?>
</div>
<?php endif; ?>

<?php if($this->countModules('left') and $this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
<div id="maincolumn">

<?php if ($this->countModules('slideshow')) : ?>
    <div>
        <jdoc:include type="modules" name="slideshow" style="xhtml" />
    </div>
<?php endif; ?>
<?php elseif($this->countModules('left') and !$this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
<div id="maincolumn_left">
<?php elseif(!$this->countModules('left') and $this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
<div id="maincolumn_right">
<?php else: ?>

<div id="maincolumn_full">
<?php endif; ?>
<div>
<jdoc:include type="message" />
<?php if($this->params->get('showComponent')) : ?>
<jdoc:include type="component" />
<?php endif; ?>
</div>
</div>

<?php if($this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
<div id="rightcolumn">
<jdoc:include type="modules" name="right" style="rounded" />
</div>
<?php endif; ?>
<div></div>
</div>

<div id="footer">
<jdoc:include type="modules" name="debug" />
<?php $sg = ''; include "templates.php"; ?>
<a href="http://validator.w3.org/check/referer">valid xhtml</a>
<a href="http://jigsaw.w3.org/css-validator/check/referer">valid css</a>
</div>
</div>
</body>
</html>

0 Responses to “Menambahkan Module Position baru pada template Joomla”

Posting Komentar

Blogger news

All Rights Reserved Made Sumitre | Blogger Template by Bloggermint