The Techjoomla Blog

Stay updated with all the latest happenings at Techjoomla. From news about the developments in your favourite extensions to Tips & Tricks about the Joomla CMS, Framework & Development.

Posted by on in Joomla Development

There has been a growing trend to start offering RESTful services for any web product, and Joomla is no exception. With Joomla however there is no "preferred" way of writing RESTful services so everyone (that includes us) is trying to build their own component and plugin to enable RESTful services in Joomla. This blog attempts to list out the various approaches available and the benefits of using each.

 

Using the JSON document type (format=json)

This is perhaps the oldest and most common way to do JSON over REST. This method is supported inherently by Joomla and developers just need to provide a view.json.php into each of their views to expose the data from the model via JSON. Framework on Framework (FOF) goes a step further and you don't need to create this file if the default output from the model is sufficient to you.

PROs

  1. No extra extensions needed
  2. Present directly inside a component so very easy to use model methods

CONs

...
Continue reading
Tagged in: api json rest
Hits: 296 Comments
Rate this blog entry:
0

Posted by on in Joomla Development

Today, its critical that your site is mobile friendly. More and more people are accessing the web via their mobile devices. The Joomla native Joomla modal popup is not responsive by default. Here’s how you can make it responsive.

 The Code to make it happen !

1. Import following library at the start of the page. Please make sure you embed this code in php start and end  tags.

JHTML::_('behavior.modal', 'a.modal');

 This simply ensures that the modal.js script and the modal.css style sheets are loaded, plus the mootools javascript framework which the script requires, and initialises the modal window. Note that from Joomla 3.3x onwards using JQuery might be a better idea. 

 

2. Add following function in javascript

$(document).ready(function() {
	var width = $(window).width();
	var height = $(window).height();

	//ID of container
	$('a#modal_info').attr('rel','{handler: "iframe", size: {x: '+(width-(width*0.10))+', y: '+(height-(height*0.10))+'}}');
});

If we give modal size directly in html then it will not make modal popup responsive. So for that we have used javascript to give size to the modal.

To give size to the popup window, first we dynamically calculated window size and gave that size to the modal window so this can make our modal popup responsive. 

3. Now you need to invoke the modal in your html with the code below.  Give same id to the javascript and container.

<a

	id="modal_info"
	href="#"
	class="modal"
	>
</a>

 To create a popup you simply give the css class 'modal' to the link <a> tag which links to the content you want to display just like you would normally do ! 

Hits: 1733 Comments
Rate this blog entry:
0

Posted by on in Joomla Development

This Blog is specially targeted for developers and people who use Jomsocial

b2ap3_thumbnail_download_20140710-115328_1.jpg

Jomsocial!
  Which turns Joomla CMS into a full-fledged social
networking website. While using your own component with jomsocial you need to make sure that your component is tightly integrated with it and most important is you are notified with the activities happening.

 

In Jomsocial, notifications are shown on the notification bar and if you use the following code provided by Jomsocial you’ll get email notifications as well. Use  Jomsocial’s Notifications API, to send  notifications to users we write following code


Code:

require_once JPATH_ROOT .'/components/com_community/libraries/core.php';

$user = CFactory::getUser();
$cmd = 'system_messaging'; // first param, type of activity
$actor = $user->id; //second param - get the id of $actor
$target = '965'; // third param. Who receive notification? In our dev environment, its admin user with id 965. At your environment, you will most likely want to get the ID from your object or from array of users.
$subject = 'Notification Subject'; // Subject of both, email and popup notifications
$body = 'This is the notification body message'; //Body message in emails.
$template = ''; // If you need to use specific jomsocial template file, you can define it here.
$params = new CParameter(''); // We want to create an additional params object, and assign data to it, without having to formally define a class
CNotificationLibrary::add( $cmd , $actor , $target , $subject , $body , $template , $params );

 

...
Continue reading
Hits: 1873 Comments
Rate this blog entry:
0

Posted by on in Joomla Development

Zoo is one of the best CCK extensions available for Joomla . It's a flexible and powerful application builder to manage your content. Especially if you are having huge data sets, Zoo can be a awesome way to manage & present it all. However with large data sets, manually adding all the data might not be practical. This is where the inbuilt Zoo import tool can help you in a big way.

In this blog we will show you how it works & also how we solve a problem that it presents if you have data with lots & lots of fields. When this happens during the import you need to manually Map the fields in your Import CSV/JSON file to the fields in Zoo so that the import can proceed. However when you have lots of fields it a huge chore to map them all manually. However with our solution you can do it in a single Click ! 

Lets how the existing Zoo Data Import Works ( Just in case you didn't know ! ) 

Data import done in following 3 stages.  Zoo allows you to import data in JSON or CSV format. 

1. Upload CSV/JSON file.

b2ap3_thumbnail_oie_2582216XM8f3drV.png

Continue reading
Tagged in: cck import zoo
Hits: 2159 Comments
Rate this blog entry:

Posted by on in Joomla Development

Are you building admin list-view in your Joomla Extension? Do you want to include Search Tools in your Joomla 3.x extension? Here is a quick guide to do so in easy steps.

First we will check the folder structure needed, and then we will see sample code.

A. Folder structure and files we will see in action here-

Folder structure -

/administrator/components/com_quick2cart/models/
/administrator/components/com_quick2cart/models/fields/
/administrator/components/com_quick2cart/models/forms/
/administrator/components/com_quick2cart/views/

Files that needs to be added / changed -

...
Continue reading
Hits: 26704 Comments
Rate this blog entry:
0