Site Recipe: Drupal 7 Membership Site
I've heard a lot of wailing that it's impossible to build anything with Drupal 7 because none of the contrib modules are ready yet. It's true, maybe your favourite esoteric dancing monkey module doesn't have a D7 version, but it's also true that Drupal 7 is ready for your business. Over the next year I'm going to be teaching people how to build and theme the most popular types of Drupal sites in the Site Building Extravaganza program.
The first site that I built for the program was the program Web site. It's running Drupal's new default theme, Bartik and boasts the following feature: member-only content area. I won't lie. I snapped together the first draft of this site in less than an hour because of some great contrib modules.
This is how you too can create a private Web site, separate from your public Web site with Drupal 7. This is perfect for membership sites, but also not-for-profits that need to share documents with members (e.g. meeting minutes, draft documents and the like). Only a few years ago this would have cost thousands of dollars to develop, now it's just a few clicks of a mouse. Here's how I added a member-only area to my Site Building Extravaganza web site:
- Install Drupal 7 and download the requisite contrib module: Node Privacy by Role. (This contrib modules goes into the folder /sites/all/modules.)
- In your new Web site click on, Modules. Enable the following module: Node Privacy by Role.
- Create a new role for the folks who should have access to "private" content.
- From the admin menu, navigate to: People, Permissions (tab), Roles (tab).
- At the bottom of the screen, type in the new role name (mine's "site builder") and click, "Add role."
- Create a new content type for your private content. (This step is optional as Node Privacy by Role allows you to adjust every piece of content individually. I'm a content type junkie though, so I created a new content type that had exactly the settings I wanted.)
- From the admin menu, navigate to: Structure, Content types. Click "Add content type."
- Adjust the settings for this content type as you would for any other Drupal site. For example: comments on, published but not promoted to the front page, don't display author settings (this is moved from the theme settings page in D6).
- Adjust the settings for "Node Privacy by Role" (this is a closed fieldset at the bottom of the screen). In my case this content type can be manipulated by administrators (edit/delete/create) but viewed by administrators AND site builders (my new role).
- Save the content type.
- Add extra fields, if you need them. For example: I've added a File field so that I can upload supporting documents, such as PDFs, to the course content.
At this point your site is ready to go. You can start adding people with the role of "site builder" and start adding content to your new site, deciding if each item should be public or private. I wanted my content to be available in a specific order though, so I've also added Views and Nodequeue. I'll show you how to do that part tomorrow.
In the mean time, sign up for sign up for the Site Building Extravaganza program and learn how to make Web sites with Drupal 7. Registration closes January 25th (that's tomorrow!) so if you've been thinking about signing up, now's the time to DO IT.

Comments
24 January, 2011 - 18:43
Jerrac
Node Privacy by Role is good, but I ran into a major problem with it. I can't tell it NOT to let anyone assign edit/delete permissions to roles that they aren't members of; or to the anonymous and authenticated roles.
Any suggestions?
Also, the Site Building Extravaganza program looks awesome. *wonders if he could find the money for it somewhere he hasn't looked already*
25 January, 2011 - 10:47
emmajane
It sounds like you may have too loose of permissions set for the module itself and you should be more restrictive of who's allowed to set the restrictions? If that's not it, my suggestion, of course, is to file a bug. :) I'm looking forward to having you in the program!
Post new comment