Drupal Tips & Tricks
Customizing your exposed filters is easy and a good way of customizing what users can select. A common example I've found is when you want users to choose from a select list but views only provides you with a textfield. Using hook_form_alter, you can easily change the #type attirbute of the exposed filter form however, one simple mistake can result in the HUGELY annoying, "Illegal choice detected. Please contact your administrator".
As I mentioned, if you are looking to override exposed filters, you can do so with:
hook_form_alter ($form, &$form_state, $form_id) {
//add some kind of if statment here to check the form_id otherwise you'll affect all your forms
if ($form['#id'] == 'views-exposed-form-[VIEW-NAME]-[WHICHEVER VIEW NUMBER]') {
...
When I started out with Drupal over a year and a half ago, I knew nothing about web design, CSS, HTML or anything. I was completely a blank slate. I knew I wanted to eventually develop Drupal modules and get into the programming side of things but the problem was I had no idea where to start. I posted in forums, talked with people and heard a bunch of different recommendations, most of which I didn't follow because they didn't make sense for someone just starting out. It was just the same answer was just handed down from person to person without any thought. Therefore, this post is going to show you how to learn Drupal module development the easiest way (I found) possible.
Step 1: Watch some PHP videos
You aren't going to be able to program in Drupal if you don't know any PHP. If you don...
Hi all,
so, following my last post, here is a great tool I've recently started using for all of my large scale Drupal projects, mind42.com. Mind42.com is an online Mindmapping software that allows you to create some crazy mindmaps and organize your thoughts before you even begin installing Drupal.
Whats a Mindmap?
For those who are unfamiliar, according to wikipedia, a mindmap is:
a diagram used to represent words, ideas, tasks, or other items linked to and arranged around a central key word or idea. Mind maps are used to generate, visualize, structure, and classify ideas, and as an aid to studying and organizing information, solving problems, making decisions, and writing.
Here is an example I did very recently after thinking about how to take my...
Hi all,
If you've come to this page to know how to rank #1 in Google in 10 days you've.... come to the wrong place. For those who want a quick answer, here is my Drupal Camp Toronto 2010 Search Engine Optimization Presentation, this will give you a list of Drupal 6 modules to install and a brief overview on how to configure them. This should get you going in the right direction. If you want more info, keep reading.
Recently, I've been toying with a few ideas and my Drupal Tips & Tricks has suffered because of it. I haven't really decided what I am going to do with this section of the website but after much deliberation, I think it's...
Time Equals Money
According to Node Import's project page, "This module allows you to import a set of nodes from a Comma Seperated Values (CSV) or Tab Seperated Values (TSV) text file." In plain language, Node Import saves you time! It's a module that allows you to take a list of your content, organized into columns of data of course, and import it into your Drupal site in one shot. Why is this important? Because with Node Import, you don't have to manually upload your products, blog posts, web pages, etc. one by one. Instead the module does the heavy lifting.
For someone new to Drupal, like I was, one of the tough things to wrap your head around is the concept of nodes vs. pages. Pages are the actual...
Recently, I've been doing some work on a site which requires users to be able to review nodes but users should only be able to provide one review per node. This is because there's a ranking system incorporated with the reviews (I'm using the Drupal Five Star module for this). So, before I started custom coding, I thought I'd take a look at drupal.org some something that could provide the functionality I was looking for. Low and behold, the Nodereview Module.
The Node Review module provided the exact functionality I needed, it creates a new "content type" for which you can define which other content types can be reviewed. I have the quotation marks because it is not really a typical content type... Additionally, Nodereview can integrate with the Fivestar module allowing you to create axes which users can vote the node on. The...
