قالب جوملا از چند بخش تشکیل شده است »
1- فایل های php
2- فایل های css
3- فایل های جاوا اسکریپت
4- تصاویر
5- فایل های کمکی ini , xml ,png ,html ,ico
فایل های php که اصلی ترین آن فایل index.php می باشد همان ظاهر کلی را طراحی می کند ، برای جزئیات شما میتوانید فایل مربوط به هر قسمت را در پوشه html بارگذاری کنید ، نمونه این فایلها به همراه برنامه های جوملا در پوشه های component و modules قرار دارند که می توان برای هر قالب سفارشی نمود ، البته اگر پوشه html خالی باشد جوملا از ظاهر پیش فرض خود استفاده می کند.
فایل های css فایل های چینش و رنگ بندی سایت را تشکیل می دهند اصلی ترین فایل این قسمت template_css.css یا template.css می باشد ، بهتر است تمامی کدهای مربوط به چینش و رنگ بندی در این فایل ها قرار گیرد ، اینطوری دیگر برای یافتن یک کد گیچ نمی شوید.برای صدا زدن فایل css باید از کد زیر در قالب استفاده شود :
Code: Select all
<link href="<?php echo $this->baseurl ?>/templates/template_name/css/template_css.css" rel="stylesheet" type="text/css" />
Code: Select all
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/template_name/js/java_file_name.js"></script>
Code: Select all
<img border="0" src="<?php echo $this->baseurl ?>/templates/template_name/images/image_file_name.png" title="No Image" />
فایل templateDetails.xml فایل نصاب و کنترل کننده جوملا می باشد ، این فایل دارای فرمت زیر است :
این قسمت اطلاعات اولیه برای شناسایی فایل توسط جوملا قرار دارد:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//National CMS 1.5//DTD template 1.0//EN" "http://www.mitra.ir/xml/1.5/template-install.dtd">
<install version="1.5" type="template">
Code: Select all
<name>template_name</name>
Code: Select all
<creationDate>11/20/06</creationDate>
<author>R.Balvardi</author>
<authorEmail> [email protected] email address is being protected from spam bots, you need Javascript enabled to view it </authorEmail>
<authorUrl>http://www.mitratemplate.com</authorUrl>
<copyright></copyright>
<license>GNU/GPL</license>
<version>1.0.2</version>
<description>Software company and IT technology template with multi lingual and page direction support</description>
Code: Select all
<files>
<filename>index.php</filename>
<filename>templateDetails.xml</filename>
<filename>template_thumbnail.png</filename>
<filename>params.ini</filename>
</files>
Code: Select all
<positions>
<position>left</position>
<position>right</position>
<position>top</position>
<position>user1</position>
<position>user2</position>
<position>user3</position>
<position>user4</position>
<position>banner</position>
<position>footer</position>
</positions>
Code: Select all
<params>
<param type="spacer" default="Template Logo" />
<param name="logoType" type="list" default="image" label="Logo type" description="LOGO TYPE DESCRIPTION">
<option value="image">Image</option>
<option value="text">Text</option>
</param>
<param name="logoText" type="text" default="" size="50" label="Logo text" description="LOGO TEXT DESCRIPTION" />
<param name="sloganText" type="text" default="" size="50" label="Slogan" description="SLOGAN DESCRIPTION" />
</params>
Code: Select all
<languages>
<language tag="en-GB">en-GB.lang_file.ini</language>
</languages>
<administration>
<languages>
<language tag="en-GB">admin/en-GB.lang_file.ini</language>
</languages>
</administration>
Code: Select all
</install>
آشنایی با کدهای قرار گرفته در فایل index.php قالب جوملا:
کد محافظت در مقابل سوء استفاده هکرها در قالب : این کد جلوی اجرای مستقیم فایل قالب را میگیرد و به هکر ها اجازه رویت محتوای قالب را بصورت مستقیم نمی دهد.
Code: Select all
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
Code: Select all
<jdoc:include type="head" />
Code: Select all
<jdoc:include type="modules" name="left" style="xhtml" />
Code: Select all
<?php echo $this->baseurl ?>
Code: Select all
<?php if($this->countModules('top')) : ?>
<?php else: ?>
<?php endif; ?>
Code: Select all
<?php echo $this->language; ?>
Code: Select all
<?php if($this->direction == 'rtl') : ?>
<?php endif; ?>
Code: Select all
<?php echo JText::_('Powered by') ?>
Code: Select all
<jdoc:include type="message" />
Code: Select all
<jdoc:include type="component" />