Eclectic but Useful Drupal Modules
I guess I could have named this post "X number of unusual Drupal modules you can't live without" but then it would have been a bit clichéd. This is an overview of an eclectic mix of modules I've found really useful lately for some projects I've been working on with a few examples and use cases. Most of them I've stumbled across after intensive Google searches looking for that one feature I needed.
Image URL Formatter
This module allows you to render the URL for an image and image style. This is fabulous for themers who simply want the image URL for minimalist output to then tweak for their own purposes. My use case was that I wanted to add a lightbox wrapper around the image style URL in Views. I supposes I could have come up with a pre-process function using field_get_items
but after an exhaustive search, could not figure this out for Views, only for Nodes. I installed this module and boom, a few minutes later I was up and running.
So in a custom views template, I can do something like this:
<a href="print $fields['field_gallery_image']->content ?>"
class="my-image-link my-lightbox" style="opacity: 1;"
title="print $fields['title_field']->content ?>">
[your title, image or content here that you are wrapping the a tag around…]
</a>
Of note here is that I've set within Views a URL and image style for field_gallery_image
. As you might imagine, the theming possibilities are endless.
TVI (Taxonomy Views Integrator)
This module enables you to set a custom View for any Taxonomy (Vocabulary) via the Views module. I wrote about how to do this in a previous post, "Custom Taxonomy Pages with Drupal Views Using Selective Overrides", see the resources at the bottom for more info. Basically, this module allows you to substitute an ultra customized view for Taxonomy Term pages. My use case is that I needed to turn a specific Vocabulary into elegant looking gallery pages but I did not want to override the default View that can be used for all Taxonomy pages. In essence, I can leave the default View be, create a custom View for my target Vocabulary and then tell TVI to use that View.
Image Allow Insecure Derivatives
What can I say about this one, ever since Drupal 7.21 came out, I've had several issues with images not displaying. I've followed several issues on drupal.org in regard to this and there seems to be no clear solution for some people. It's a tricky issue to reproduce. One solution suggests to put this in your settings.php file:
$conf['image_allow_insecure_derivatives'] = TRUE;
However, that did not work for me but for whatever reason, this module does work to fix the missing image issue so it's a case of, "it just works."
Flippy
This is a little gem of a module. It does one thing and does it really well. It provides paging between nodes of the same content type. This is ideal for a blog where you'd like to show the previous and next blog post and that's my use case for a new site I'm working on.
I always thought this was a cool feature that was baked in to WordPress so here it is in Drupal. What's nice about this is if you have the Token Module enabled, you can set tokens for the previous and next links:
« Previous: [node:title]
Next: [node:title] »
… and voila, you now have a pager between nodes with linked tile and all.
Image formatter link to image style
Wow, that's pretty long winded but the title says it all. A great module for themers, I just wrote in depth about this one too recently. It allows you to link an image field to itself but with a specific image style. My use case was a lightbox gallery set within nodes so it allows me to have my lightbox image as an entirely different image style then my thumbnail image. The rest of it as a theming task to get it all to work.
Five seems like a good number for this article so I'll stop there and perhaps do a "part two" at one point.
Resources
- Flippy
- Image formatter link to image style
- Image Allow Insecure Derivatives
- Image URL Formatter
- Taxonomy Views Integrator
- Custom Taxonomy Pages with Drupal Views Using Selective Overrides
- Understanding [Image Allow Insecure Derivatives] more and my specific images issue.
- image styles not creating files (no thumbnails or custom styles) on some servers
- Existing hardcoded images can break after updating to Drupal 7.20 if image styles have been re-saved