Views: Displaying the subgroup of current group

  • 9 October 2013
  • mohit.aghera

This article will create the simple view that will display the sugroups of current group.

I have written an article for creating the subgroup of groups:

Actually i have used the default view provided by the organic group module, but have made a little tweak like changing the content type and etc..

You can directly import the view for the usign.

$view = new view();

$view->name = 'og_subgroups';

$view->description = 'Show all content (nodes) of a group.';

$view->tag = 'og';

$view->base_table =

Virtual host configuration in Ubuntu 13.04

  • 29 September 2013
  • mohit.aghera
Now a days I am learning symfony framework.
While installation I came across the need to configure the virtual host on my ubuntu.
Here is what I found on the Ubuntu online documentation.
In Apache2 ships with a virtual-host-friendly default configuration. That is, it is configured with a single default virtual host (using the VirtualHost directive) which can modified or used as-is if you have a single site, or used as a template for additional virtual hosts if you have multiple sites.

Linux Swiss army knife one liners [ Delete all the directories with specific extension]

  • 26 September 2013
  • mohit.aghera
Now a days i am using GIT for version control, so I had old repositories which contains .svn folders.
I wanted to remove all the .svn directories from the system.
While googling i found one useful command to delete all the directoris with one line,,
SYNTAX in Current Working Directory:
find . -type d -name <dir_name> -print0 | xargs -0 rm -rf
find . -type d -name .svn -print 0 | xargs -0 rm -rf
Find command takes many arguments.
I want to find all the directories starting with .svn so i used -type option
You can use -type with d option to specify

Drupal form error message displaying on next page reload

  • 18 September 2013
  • mohit.aghera

Today while working I faced with very strange situation. On my theme I had displayed/rendered a block. I had displayed block on the welcome page and using following code.

In my template aka tpl file, I had written this code:

<div class="content">
    <?php print render(drupal_get_form('user_login_block')); ?>


Now, Error messages related to the login (e.g. "Password incorrect.", etc.) were not getting dispalyed when the login failed.  They would show up only after reloading the page again. So during next page reload the error message of previous page were being displayed.

What I


Multiple file upload usind Drupal 7 Form API

  • 4 September 2013
  • mohit.aghera

Some days ago I was working with very strange situation. I was implementing the multiple file upload. I googled it and found many solution like plupload and html5 upload any many more…

But I was curious whether can I implement with drupal form API or not. After digging little bit what I found was really interesting and awesome solution. Though I implemented using plupload but this solution using Drupal Form API is too good..

Here is how I achieved it..

I was integrating it in filedepot module, and in this module file upload is handled by the custom Ctools file upload form, so i have to do