attractive, usable web applications


Richard's Blog - Design, coding and life in Japan

Richard

Giving up on views in Drupal

Whats wrong with views? 

If you can't hand code PHP or can't be bothered with working out the joins on Drupal's data structure then fine, it can save you having to deal with that. 

But did you know that the uncompressed folder size of views is a whopping 9.2 megs, which is over 4 times the size of drupal itself. Not only that but fiddling around with those little buttons, having to create 2-3 template files for each unique view you may have was getting too much for me. Organizing this and maintaining this a pain.

Drupal Block Module

Creating a block in Drupal with a  preprocess method can be a smooth replacement for your bulky views. It is amazingly easy to add simple blocks in Drupal and if you aren't doing so I encourage you to right away. In about 15 lines of code (I will post some examples later) and 1 (yes 1) template file you have all you need to add your custom block. No more fiddling about with default views, forgetting to press save, pressing about the over-ride button about 10 times to realize you have forgotten something later.

Sure you will need to add a couple of custom pages that views created for you out of the box, but once you get your hands dirty with the code in Drupal you realize that, Drupal was made to get stuck into the PHP. Custom screens and fancy GUI's can get in the way and in this case.

Drupal 7

I have had a play with the beautiful Drupal 7, interesting CCK (I am a big fan of CCK) is now part of the core but views aren't. This leads me to believe there are others that believe our lives will be happier without views.

I am relative Drupal newbie so I would love to hear if anyone else has similar experiences.

Tags:

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Recent Blog Posts