Saturday, February 26, 2011

joomla1.5 advanced tips

         Here we going to see some of the advanced concepts in joomla1.5.


USE OTHER COMPONENT LANGUAGE FILE:
-----------------------------------------------------------

         In joomla we have the option to maintain separate language file for each component.if you want to use other component language file to your component here is the solution for that.we can able to controll it by using JFactory class

$lang = JFactory::getLanguage();
$lang->load('component_name');
echo $lang->_('LANGUAGE_KEY');

No need to use JText for this.

INCLUDE OTHER MODLE TO YOUR VIEW:
---------------------------------------------------------

  By default joomla we can able set a single model to particular view, but we need to call some function that one not avail in another one model mean , need to just include the model and create the instant for that using this JModle::addIncludePath()
JModel::addIncludePath( 'Model path' );
        $model           =JModel::getInstance( 'type', 'prefix for model class name');
        $return            =$model->getYourFuctionName();



LOAD MODULE WITH IN CONTENT AREA:
--------------------------------------------------------

joomla1.5 have defaule plugin do render the module with in your content area.You can call any module position in a content item.

(ex)  {loadposition yourpositionname}

No comments:

Post a Comment