Change default columns in Drupal grid view

I’ve been working with Drupal templates these past weeks and I needed to make a photogallery.

I found a great resource for doing it following this nice video. But because of the space available in my template’s design, I needed 3 columns intstead of the default 4 on my grid view.

So what I had to change to do that, is in the modules/views_bonus_grid.module and on line 20, you change: // set default count. $cols = $view->gridcount ? $view->gridcount : 4;

with:

// set default count. $cols = $view->gridcount ? $view->gridcount : 3;

Place whatever number you want, and there you have it.

I know that editing the module itself is not the best way to do it. But it works and its the quickest way to get it done.

Related posts:

  1. Change your default browser to Chromium in Debian and Emacs

About Gabriel Saldaña

Web developer and free software advocate.
This entry was posted in personal. Bookmark the permalink.

Comments are closed.