Quicktips
Too many modules do the same thing? Compare features, versions and integration on groups.drupal.org
- Read more about Too many modules do the same thing? Compare features, versions and integration on groups.drupal.org
- Add new comment
One of the many wonderful and useful forums over at groups.drupal.org is the Similar Module Review group.
Create Collapsible jQuery Boxes with Drupal
Edit: you can also use ctools
Is there too much text on your page? Do you need to allow users to un-clutter an interface, or hide some of the interface until your users need it? Don't go and grab any extra JavaScript, Drupal can do collapsible fieldsets out of the box!
However, there are some steps involved:
HTML Filter Side Effects
The HTML Filter that comes with Drupal core is extremely useful - it allows you to restrict the HTML elements that you allow your content creators to use in their posts. If you don't want them including images or JavaScript, no problem. The filter settings allow you to specify exactly what HTML elements they are allowed to use.
Views Bulk Operations Main Admin Content Screen
One of the most actively used administration pages on any drupal site is the main content administration page (admin/content/node). From this page, the site administrator can quickly get a list of all the nodes on their site as well as filter and sort the list in a variety of ways.
However useful you may find this, you may not be aware that the Views Bulk Operations module provides an even more useful main content administration page with the often requested "search by title" filter.
Overridding the node.tpl.php File
If you've done much Drupal theming, then you're probably aware that you can override the default node.tpl.php template file on a per-content type basis. For example, if you have a content type called "food", then you can create a node-food.tpl.php that will be used only when nodes of type "food" are displayed.
A full list of template suggestions can be found on drupal.org.
Exposed Filters on Block Views
Exposed filters in Views are a wonderful thing. They allow your site visitors the ability to dynamically alter a view to suit their needs best. But what happens when you display your view in a block?
Exposed filters on View pages use URL querystring variables to pass the filter variables back to the server, but when your view is displayed in a block, this isn't possible.
Exporting Data to Microsoft Excel
Need to export data from your Drupal web site to Excel?
Use the Views Bonus Pack module - it gives you the ability to set your view's style to CSV, XML, DOC, and other formats.
Check it out!
Better Messages
I recently presented 45 Modules in 45 Minutes: The Best Modules You're Not Using at DrupalCon Paris. Here's a tip using one of the forty-five modules in my presentation.
The Better Messages module is a quick and simple drop-in module that will instantly give your site a bit of a "wow" factor by displaying all system messages in a floating CSS popup window over your content.
Setting Default Year in CCK Field
If you use CCK often, then you've probably at least once had to implement a select box where the user can select a year value. Sometimes they're used for birthdays, magazine issues, events, or even historical reasons.
You can easily populate the "Allowed values" textarea of the field's "edit" page, but how can you quickly set the default value to the current year (and not have to worry about changing it every year)?
Browser FAIL: "Unsupported form of compression" related to PHP notice
One of my sites had a funny error complaining about an "unsupported form of compression" shortly after installing a new module. The browser would return a white screen of death with an error message (Safari and Firefox).
Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
Showcase a User's Comments with Views and Menu Tabs
By now, you should know and love the Tracker module that comes with core. It has its strengths, but many weaknesses. For one, you can't separate out posts from comments, or sort the list in interesting ways. Views can help you make exactly the list you want, and place it in a tab on the user's profile exactly like the "Track" tab.
For this example, you'll be adding a list of comments. Creating the view is simple enough:
- Clone the default view comments_recent, and call it comments_by_user
- On the Page display, add a Relationship for Comment:User
Adding photos to an event page with Views Attach
There are often 17 ways to do any particular action with Drupal - here is #18 on the list of "How do I display related content on this node's page?" You'll be using the Views Attach module and a nodereference field.
In this example, you want to relate a photo to an event. Inside the photo's content type, create a nodereference field that is able to reference the event content type. When a user is adding a new photo, she will be able to choose the related event if applicable.
I Just Want to Change That One Word!
If you develop Drupal sites for clients, then you've no doubt been requested to change some of the default language found in Drupal core and/or contributed modules. For example, instead of "My account", your client wants it to read "User info". Or instead of "Create content", they request "Add stuff".
Ubercart Product Quantities
Depending on what type of product you sell on your Ubercart powered Drupal site, you may want to make it even easier for your users to increase the quantity of what they're ordering.