Monday, April 30, 2012

Create collapsible content area in joomla

open selected template index.php file and put below code where you want to collapse div.

<div id="content">
     <?php if($this->countModules('content_right')) : ?>
       <div id="content_left"><jdoc:include type="message" /><jdoc:include type="component" /></div>
     <?php elseif(!$this->countModules(' content_right ')) : ?>
       <div id="content_full"><jdoc:include type="message" /><jdoc:include type="component" /></div>
     <?php endif; ?>

Friday, April 27, 2012

Some Important syntax of Joomla

Here are the some codes to help the joomla developer..

login user details 

$user =& JFactory::getUser();
echo $user->id;
echo $user->username;
echo $user->name;
echo $user->email;
echo $user->usertype;
echo $user->guest;
echo $user->get('aid'); // access Guest 0, register 1

Display JSON data

Create a function to get data json data.

function getjson(){
var url = "https://sitename/getdata.php";
requestCrossDomain(url, function(results)

// result = {" resultdata ":[{" imgname ":"2147512358.jpg"," name ":"bhumika"},{"imgname
//                  ":"2411827535.jpg"," name ":"rahul"}]}

var myJSONObject1 = eval('(' + results + ')');
if(myJSONObject1== null)
return false;
return false;