Joomla Constants


Following is list of constants that can be used in Joomla:

01.JPATH_ADMINISTRATOR   The path to the administrator folder.
02.JPATH_BASE  The path to the installed Joomla! site.
03.JPATH_CACHE   The path to the cache folder.
04.JPATH_COMPONENT   The path to the current component being executed.
05.JPATH_CONFIGURATION   The path to folder containing the configuration.php file.
06.JPATH_INSTALLATION  The path to the installation folder.
07.JPATH_LIBRARIES   The path to the libraries folder.
08.JPATH_PLUGINS   The path to the plugins folder.
09.JPATH_ROOT  The path to the installed Joomla! site.
10.JPATH_SITE  The path to the installed Joomla! site.
11.JPATH_THEMES  The path to the templates folder.
12.JPATH_XMLRPC  The path to the XML-RPC Web service folder.

Joomla Template Variables


Website Root path

01.<?php echo $this->baseurl ?>
02.
03.Template name
04.<?php echo $this->template;?>
05.
06.$this->baseurl;
07.$this->template;
08.$this->params; // Template specific params object -- defined in the params.ini file
09.// From JDocument:
10.$this->base; // Document base URL -- redundant, as far as I can tell
11.$this->description; // Document description
12.$this->direction; // Contains the document direction setting (default='ltr')
13.$this->language; // Contains the document language setting (default='en-gb')
14.$this->link; // Document full URL
15.$this->title; // Document title
16.$this->_generator; // Document generator (default='Joomla! 1.5 - Open Source Content Management')

Turn off/Remove Mootools in Joomla template on frontend


Use following code to turn off/remove Mootools in Joomla template on frontend.

01.$user =& JFactory::getUser();
02.if($user->get('guest') == 1) {
03.$search = array('mootools', 'caption.js');
04.// remove the js files
05.foreach($this->_scripts as $key => $script) {
06.foreach($search as $findme) {
07.if(stristr($key, $findme) !== false) {
08.unset($this->_scripts[$key]);
09.}
10.}
11.}
12.}

Retrieving Joomla 1.5 Component, Module, Plugin and Template Parameters


In Joomla 1.5 parameters enable users to configure settings that later can be used in code of extensions and templates. Following are the ways that can help a developer to access these parameters.

Component Parameters

From inside a Component:

1.$componentParams = &JComponentHelper::getParams('com_example');
2.$param = $componentParams->get('parameter_name', 'default_value');

From outside a Component:

1.$componentParams = &JComponentHelper::getParams('com_example');
2.$param = $componentParams->get('parameter_name', 'default_value');

Mô hình MVC trong joomla


I)Tại sao cần phải biết mô hình MVC trong joomla ?
– bạn sẽ dễ dàng tìm được những lỗi phát sinh nếu nắm rõ mô hình này. Tuy nhiên trên thực tế có một số extension viết không theo chuẩn của joomla thì chúng ta không bàn đến (1 ví dụ to đùng : Virtuemart version < 2.0).
– Nâng cao tốc độ website vì một số biến , dữ liệu quan trọng sẽ được joomla tự động ghi vào cache.
– Dễ nâng cấp tính năng nếu có nhu cầu phát triển thêm.
Tiếp tục đọc