New Drupal Featured Content Module
NatureBridge.org was interested in having functionality to allow their own staff to easily add featured content blocks on their site without having to rely on their programmer (me! :)
First, I looked into all the existing Drupal modules on drupal.org to see if there were any that would satisfy their requirements. Unfortunately, I wasn't able to find any that were close enough to what they needed. They wanted to add blocks of content based on content type(s), author(s), and term(s), and they wanted to be able to create as many blocks as they desired, and they wanted RSS feeds for these lists, and it needed to be *simple* (sorry, no views!). (See list at very bottom of modules I looked into.)
So, initially, I thought I'd just make a custom module that was just tailored to their needs, but quickly realized that I could make the module generic to use for anyone in a similar situation. NatureBridge graciously agreed to let me take ownership of the module, enhance it beyond their current needs, and submit it to drupal.org. You can download it here: Featured Content Module
This new featured content module is useful if you have non-technical staff who need to add blocks on the site that contain lists of node titles, node teasers, and/or full node content. This module can also be useful if you need to get up some related/featured content blocks quickly and are not familiar enough yet with views to do it.
The content that shows up in the block depends on how the user configured the block. The content can be sorted alphabetically, by date, or by popularity, or can presented randomly. There are additional visibility rules available so you can choose to show the block based on the content type, user/author, or taxonomy terms available for the node page being viewed.
One option is to specify a manual list of paths to show. The advantage of this is if you know the pages you are interested in, but want them sorted in a particular way or you want to apply some additional rules for when the block should show up.
The other option is to specify a number of filters to determine what content will be displayed. You can filter by content types(s), user(s)/author(s), taxonomy term(s), and by path. You can match the content type, author, or terms of the current node being shown, or can configure it independent of the page being shown.
Here are some examples of blocks you can create:
- List of nodes that have the same author as the node being shown
- List of nodes that have the same content type as the node being shown
- List of nodes that have one of the same terms as the node being shown
- List of nodes that start with the same path as the node being shown
- List of nodes that are a chosen content type or types
- List of nodes that are authored by a chosen author or authors
- List of nodes that contain one of the chosen taxonomy terms
These can be combined as well. For example, you could chose to show a list of nodes that have the same author *and* content type as the node being shown.
Here are some screenshots:
Modules that I reviewed before writing this module:
This is a featured content block that has been configured to show blog nodes with terms SEO or Drupal SEO by the author kristen. It shows random list of 20 results in the block and 30 results on the more page.