Module Monday: Premium Content

How to Prompt Users with Permission to View Premium Content, for Drupal 6 & 7

Drupal's node access system provides a basic framework for hiding nodes from unprivileged users, and a bevy of third-party modules us it to restrict access based on content type, group membership, and more. Sometimes, though, you don't want to hide content entirely. If you're teasing visitors with a glimpse of premium content, you don't want nodes to be completely hidden. What you need is the Premium Content module.

Based on the venerable Premium module for Drupal 4.7 and 5.0, Premium Content leaves node teasers untouched, ensuring that content shows up as normal on listing pages. When a user who doesn't have permission to view premium content visits the node's full page, however, they get a message prompting them to register or upgrade their account.















Screenshot of premium-access content

Premium Content ships with automatic support for two common "premium scenarios." Archival mode leaves all nodes publicly visible when they're created, but automatically marks them as premium once they're two weeks old. "Embargo" mode keeps content premium when it's posted, but releases it to the public after two weeks. Administrators can customize the time periods for those automatic changes, or switch to manual mode, allowing authors to designate individual nodes as premium when they're created.

The module really shines when combined with Panels. The "premium" status of a node can be used as part of a panel's context, allowing crafty site builders to create a totally customized display for the "promotional" version of a premium node. In addition, all of the module's settings are exportable and can be captured using the Features module.















Screenshot of Premium Content configuration screen

Premium Content isn't without its downsides: the "limited" version of a premium node is tough to customize if you aren't using Panels. In a perfect world, Premium would provide a special Build Mode and allow administrators to customize how each FieldAPI field should appear. In addition, there's no way to customize the special "Upgrade your account!" message based on the details of the user who's viewing it. If you'd like to show one message for anonymous visitors and another for "basic" users who need to upgrade, you'll have to do some hacking.

With those caveats, however, Premium Content is a flexible solution to a sticky problem. If you need to promote your members-only content while keeping it exclusive, check it out!

Get in touch with us

Tell us about your project or drop us a line. We'd love to hear from you!