Thursday, September 13, 2012

Drupal Training to Colleges in and Around Chennai with IEEE- VIT chennai

It’s been a passion of the Drupal community in Chennai to reach out to Colleges and share the joy of Drupal development. Over the last  years we have visited  4 colleges. The last one was in coordination with IEEE.

This time it was  a paid Drupal training program organised by IEEE. The program spanned over 3 full days. The first 2 days was to introduce the students to Drupal and PHP concepts. The students thoroughly enjoyed their hands on session on Drupal.

This was followed by an assignment in Drupal. The 3rd session was further to submission of the assignment. During this day a team of 9 trainers spent one to one session explaining the details of their respective assignments to the students. The interest of the students to learn Drupal was amazing...

The program was extremely successful!

The reasons for the success:

  • The IEEE team made extreme care to ensure the coordination with participants, students & trainers we immaculate.
  • The excellent Venue at VIT
  • Training conducted by professionals working on Drupal
  • A set of extremely interested students.

Three cheers to the IEEE team & the Drupal enthusiasts. Looking for more excitement together.

More pictures at: https://www.facebook.com/media/set/?set=a.420750574642961.117256.143106039074084&type=3
About the training at: http://groups.drupal.org/node/244013
Link to IEEE report on the program: http://ewh.ieee.org/r10/madras/?q=ieee-cs-drupal-vit

Any Colleges looking for drupal training workshops connect with us at: drupalinchennai@gmail.com

AT THE PROGRAM






Friday, April 27, 2012

Building Responsive Websites with Drupal

Responsive Design is the current approach to website designs. This is still a new area & the devices we are trying to design for varied. But yes you have a solution in Drupal, a ready to use theme that supports responsive theming.  The presentation gives an overview of what Responsive websites mean & the key terminologies that we need to understand.

This presentation is inspired by many presentations on Responsive theming at recent Drupalcons. A link to the London con page on responsive design: http://london2011.drupal.org/category/tags/responsive-design

Wednesday, January 4, 2012

An Introduction to Imagemagick with PHP

Last week I had chance to work with imagemagick, I was amazed by seeing the list features available with this library to create or edit an image. Here is a brief on ImageMagick 


What is imagemagick?
ImageMagick® is a used to create, edit, compose, or convert images. It can read and write images in a variety of formats. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and B├ęzier curves.


How do I install ImageMagick?
For installing the ImageMagick in linux, download the build Imagemagick.tar.gz. Install the build as instructed here.


Unpack the build 
$ tar xvfz ImageMagick.tar.gz


Configure and Compile
$ cd ImageMagick-6.7.4
$ ./configure
$ make
If ImageMagick configured and compiled without complaint, you are ready to install it on your system. Administrator privileges are required to install. To install, type
$ sudo make install
You may need to configure the dynamic linker run-time bindings:
$ sudo ldconfig /usr/local/lib
Finally, verify the ImageMagick install worked properly, type
$ /usr/local/bin/convert logo: logo.gif
For a more comprehensive test, run the ImageMagick validation suite. Ghostscript is a prerequisite, otherwise the EPS, PS, and PDF tests will fail.
$ make check

The same can also be installed in windows, instructions can be found here


Imagick is a native php extension to create and modify images using the ImageMagick API. This extension requires ImageMagick version 6.2.4+ and PHP 5.1.3+.
Install Imagick extension as usual way of pecl installation.
Copy the imagick.so to php ext directory usually (/usr/local/php/ext).
Edit the php.ini add the installed extension 'extension=imagick.so'
Restart the Apache

After Sucessful installation check the imagick availabilty with phpinfo()

If every thing goes fine, Now we can test it by writing a small program in php
<?php
header('Content-type: image/jpeg');
$image = new Imagick('image.jpg');
// If 0 is provided as a width or height parameter,
// aspect ratio is maintained
$image->thumbnailImage(100, 0);
echo $image;
?>
Imagick class constructed by loading a image 'image.jpg'.
In the next line a member function thumbnailImage is called to resize the image width as 100 pixels. This function takes two parameter first is width and next is Height.
Height assigned as 0 in the function to maintain the aspect ratio.

Monday, November 14, 2011

Implementing High Performance Drupal Sites

The Main Aspect covered during the Session:

  1. What is “Performance”?
  2. Different Layers of Performance
  3. How to configure Drupal for Performance
  4. Writing Drupal Modules for High Performance
  5. Some Advanced Techniques & Caching Systems
  6. Event Based Caching
  7. Drupal 6 vs Drupal 7
  8. Performance in Drupal 8

Questions Asked after the Session:

Q: Why did you use Panels for the Deccan Chronicle Home, though Panels could be a performance hazard?

A: Panels with the support of Ctools provides us many features to build a page or mini panel with drag and drop, create own layout, etc. These abstractions/features make panels a heavy module to use. Yes absolutely true, but we need to balance user experience and requirement with performance. Hence Panels was to give better user experience to the Editor who manages the site. Being aware of the implication on performance, we planned the cache very effectively by using time based (tradition) and event based cache clearing systems. We enabled the cache in all panes and pages in the panels.

Q: Is  Boost a good option?

A: Boost is a good option for anonymous users and hosting is in shared environment, where you will not have option to install other advanced cache support modules like memecache or varnish. Boost will serve the cached static html files for the configured cache lifetime, once the lifetime expired static html page will be regenerated. When we compare Boost and Varnish, Boost caches the content and delivers it without disturbing MySql. Varnish works at a layer above Apache. Another difference is Boost uses the file system (disk) where as varnish uses RAM. Refer  http://groups.drupal.org/node/46042, http://cruncht.com/95/drupal-caching/. The benchmarking helps to decide that varnish is better than Boost. As the time old concept RAM is faster than Disk. So if you have infrastructure to install Varnish then Varnish is the better option.

Q: Writing custom query to get required information from node vs using node load

A: This question was in many of the developer's mind. node_load is a function which loads or constructs the node object by querying the database. This function uses static variable so if the node object is constructed once, then from next time it will be serving the node object from the static variable (static variable life time only limited to a single page load). Now we see how to decide on node_load or querying the table, this is depends on the use case I suggest. The Answer is written with Drupal 6 in mind.

In a page if you want to list ten other titles written by the author of the node we are viewing, then go for Querying the table. This is because we only need to query a single table to get this information. Node load will be a overhead, considering there will joins with the node revision table, CCK fields table.

In other case you want to display list of node snippets (set of fields like title, teaser, date of node, configured fields etc. ) In this case we should use node_load, because node_load not only loads the node object from the database, it runs required on the node object. Some examples could be alternation in the teaser length or changing the date format etc.

Q: Do we use cache_clear_all() or clear the cache based on CID?

A: While writing code to clear the cache in our module always prefer to call Cache_clear_all by passing the CID and table name, by this only the cache content of the CID in the table will be get cleared. Or if you want to clear many rows you may use the wildcard option provided in the function.. In other case if you call cache_clear_all without CID and table, all expired cache content from cache_block and cache_page tables will get cleared (In case you have not assigned minimum cache lifetime then all temporary cache will get deleted). If you are storing the cache in other tables it is required to specify the table name.

We used this concept while creating event based caching system with in our application.

Note: Use Cache_clear_all() with out arguments only if required, as if not used properly it may defeat the purpose of caching.

Q: How do we show the dynamic content when we cache?

A: When we cache the content for a lifetime 10 mins, then your user will get the static content from cache for first 10 mins. After the expiry of the lifetime 10 mins, cache will be rebuilt and new content will be shown. If you don't want your user to wait for 10 mins to get the new content, then may choose from other available option is using Ajax to load the dynamic content considering the impact.

Search This Blog

Loading...

Chennai Drupal Community

drupal.org - Community plumbing

Shyamala's Drupal SEO