This article is geared to the Drupal enthusiast who is past the initial learning curve and is ready to start working with intermediate-level features.
Many times, our company 10K Webdesign is asked to build a membership-type site. This may mean a site with different "levels" of users, or membership levels, who participate on the site in varying degrees, typically for an organization like a trade association or dues-collecting group. A member site may also mean a place where logged-in members may participate in certain interactive functions like posting content, posting to a discussion forum, uploading photos, etc.
The most common scenario is a membership directory site which allows members to post their information, such as their user profile, or content on the site, if they have made an annual dues payment.
Some examples of membership sites include:
- Product reviews
- Discussions about a niche topic, event, or industry
- Event calendar
- Limited content access (e.g. a news site, or a gallery site)
- A media site that's only available to members
- Coupons or copuon codes.
With knowledege of Drupal's capabilities, as well as some of the modules used to extend the functionality, it is possible to build out a full-featured membership site.
- Modules that we use in this task:
- Acquia Drupal distribution http://www.acquia.com/downloads
- Content Construction Kit http://www.drupal.org/project/cck
- Views http:///www.drupal.org/projrect/views
- Ubercart http://www.drupal.org/project/ubercart
- Flag http://www.drupal.org/project/flag
- Private Message http://drupal.org/project/privatemsg
- Userpoints http://drupal.org/project/userpoints
With a members-related site, the hardest task is to create a list of functions and provide detailed instructions as to what "level" of user can participate in what aspect of the site. This may mean inventorying items like site content (creating content types, main pages, and menus), displays of information (views)-- including who is allowed to see which view, as well as member permissions.
In a default Drupal installation, the site requests a username and e-mail, with password optional.
The "Profile" module allows you to extend these basic pieces of information, either during the user registration process or after the user has registered. For example, you may choose to ask for additional fields such as First Name, Last Name, Bio, Facebook/Twitter/LinkedIn links, referrer, etc. For the purposes of this demonstration, we do not ask for additional information.
Consider that the "Advanced Profile Kit" offers even more relevant, community-building functions such as Zodiac sign, hobbies, children, and other "personalized" kinds of information. This kit allows users to display their most current topics that they've participated in on the site, a user picture, a private message link and contact form (if available), and other alternatives such as user relationships, user points, user badges, etc.
How to set up a membership site.
1) Set up user roles
Drupal comes with an "authenticated" member role and an anonymous (public visitor) role. The most common third role is "administrator." Note that the very first user of a site always has all-access privileges -- it's very important to take note of the first username and password.
In a membership site, there is typically a "paid members" role if you anticipate members buying a year-long membership: members may sign up and purchase this membership product to get "promoted" to the paid member level. That paid member level may be by # of days, # of weeks, or # of years. Typically it's a 12-month or 365-day period.
You may also consider setting up a "pre-authenticated" role - Login Toboggan is a model that allows a user to sign up to a "pre-authenticated" role with limited permissions prior to being assigned to a more established role, upon confirming their e-mail address is legitimate.
Admin | User management | Roles
2) Choosing modules
The Acquia Drupal distribution arrives with the most commonly-used modules for community sites.
Additional items to consider include embedded media, Google mapping and locations, private messaging, ability to upload products to sell in a marketplace, and more.
Admin | Site building | Modules
3) Creating content types
All site content in a Drupal site is a "node" and a node can be one of multiple available "content types." A content type is typically a blog post, page, image, or story, but they can also be things like reviews, products, forum topics, and others.
Content type management and assessment includes identifying if a piece of content will have any or all of the following attached: five-star ratings, comments, image attachment, locations (through Gmap), or customized fields. For example, a "Board Member" content type will probably have the First Name, Last Name, position, bio, image, and possibly a link to a contact form.
Admin | Content management | Content types | List
4) Setting permission levels
Permissions allow you to consider what type of content or functionality is allowed for each "level" of users.
- Anonymous Users have the permission to VIEW CONTENT
- Authenticated Users have the permission to VIEW CONTENT and VOTE on items
- Paid Members may VIEW CONTENT, VOTE on items, REVIEW POLL RESULTS, UPLOAD IMAGES, and POST REVIEWS
- Administrator Members may do all of the above and more.
Once all the modules are uploaded and turned on, and your content types are available, you may assign the permissions according to your plan.
Admin | User management | Permissions
5) Filling out content
- Most informational sites do not need the complexity of Drupal -- if your aim is just to create an informational or blog site, a Wordpress installation should suffice.
- However, within any site, the following are the most commonly-used pages:
- About Us
- How it Works
- Member Benefits
- Terms and Conditions
Admin | Content management | Create content | Page
6) Products and Payments using Ubercart
http://www.ubercart.org is a module that hooks into Drupal to allow products, file downloads, role assignments, shipping, taxes, and catalog management. It's an excellent tool.
In a membership site, a typical product is an "Annual Membership" and has a role assignment attached to it: when someone purchases the "Annual Membership" product, they get promoted to the "paid members" role for one year.
Admin | Content management | Create content | Product
Here is the "role assignment" attached to the product:
Here you'll see that the Global Expiration is set at12 months, so upon purchase of this product, the user gets assigned to the "Paid Member" role for 12 months.
(Note that if you want to have this type of functionality, you must first turn on Ubercart - Roles in the "Modules" first).
Here is where you may set the global role assignment settings:
Admin | Store administration | Configuration | Product Settings | Edit | Product Features
If you're using Ubercart, you'll need a payment gateway, such as PayPal or Authorize.net, to accept payments. If you choose to accept payments on your site, you'll also want to purchase SSL security on your site, to keep your user's information private and secure.
This tool allows you to set up "flags" like "save to wishlist" or "bookmark", as well as "flag as inappropriate" or "flag this user" on a membership site. This becomes very important in cases with tens of thousands of users, or hundreds of thousands of posts --- with the member community able to flag items and users, there is a degree of self-policing that can ease the burden of administering the site.
Admin | Site building | Flags | List
Flagged items may be global or per-user. Use the Rules module to assign certain actions upon a flag, such as e-mailing the site owner or the node author if, for example, an item is marked as "inappropriate."
8) Private Messaging
The Private Message module allows an in-box feature for your members and offers message tagging, sending, and reading. Remember to check permissions to assign the capability of each of these functions to a specific role of user.
Admin | Site configuration | Private Messages
In this example, authenticated users may read and delete private messages, but only paid members may read, delete, and write new private messages.
In the Block administrator you may specify where new message notifications appear. The user may also be set up to receive an e-mail at their e-mail on file, whever they receive a private message. Review the module documentation for more information.
9) User Points
"User Points" allows users to earn "points" for actions within the site like posting comments or creating new content.
Admin | Site configuration | Points settings | Points for posting nodes
Some ways to use userpoints include: upgrading to a new level, purchasing items (physical or download) with points, exchanging points, or using web points for an in-real-life equivalent e.g. a coupon or in-person meeting.
The Blocks manager allows you to specify where certain blocks should appear. Certain blocks come standard whenever you install a module. Other blocks may be created using the "Views" tool.
Admin | Site building | Blocks | List
11) Customized Views
This particular view also displays as a page and shows the user picture, their username, the roles they're assigned to, the date they joined, and their number of userpoints.
To create a new view, go to: Admin | Site Building | Views | Add
I've created this particular view as a grid of users 3 across.
Here's the export of that view:
$view = new view; $view->name = 'All_Users'; $view->description = 'All users'; $view->tag = 'All users'; $view->view_php = ''; $view->base_table = 'users'; $view->is_cacheable = FALSE; $view->api_version = 2; $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ $handler = $view->new_display('default', 'Defaults', 'default'); $handler->override_option('fields', array( 'picture' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'target' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'html' => 0, 'strip_tags' => 0, ), 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'exclude' => 0, 'id' => 'picture', 'table' => 'users', 'field' => 'picture', 'relationship' => 'none', ), 'name' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'target' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'html' => 0, 'strip_tags' => 0, ), 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'link_to_user' => 1, 'overwrite_anonymous' => 0, 'anonymous_text' => '', 'exclude' => 0, 'id' => 'name', 'table' => 'users', 'field' => 'name', 'relationship' => 'none', ), 'rid' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'target' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'html' => 0, 'strip_tags' => 0, ), 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'type' => 'separator', 'separator' => ', ', 'exclude' => 0, 'id' => 'rid', 'table' => 'users_roles', 'field' => 'rid', 'relationship' => 'none', ), 'created' => array( 'label' => 'Created date', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'target' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'html' => 0, 'strip_tags' => 0, ), 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'date_format' => 'small', 'custom_date_format' => '', 'exclude' => 0, 'id' => 'created', 'table' => 'users', 'field' => 'created', 'relationship' => 'none', ), 'points' => array( 'id' => 'points', 'table' => 'userpoints', 'field' => 'points', ), )); $handler->override_option('filters', array( 'status' => array( 'operator' => '=', 'value' => '1', 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'status', 'table' => 'users', 'field' => 'status', 'relationship' => 'none', ), )); $handler->override_option('access', array( 'type' => 'none', )); $handler->override_option('cache', array( 'type' => 'none', )); $handler->override_option('items_per_page', 0); $handler->override_option('style_plugin', 'grid'); $handler->override_option('style_options', array( 'grouping' => '', 'columns' => '3', 'alignment' => 'horizontal', 'fill_single_line' => 1, )); $handler->override_option('row_options', array( 'inline' => array(), 'separator' => '', 'hide_empty' => 0, )); $handler = $view->new_display('page', 'Page', 'page_1'); $handler->override_option('path', 'allusers'); $handler->override_option('menu', array( 'type' => 'normal', 'title' => 'All Users', 'description' => 'All Users', 'weight' => '0', 'name' => 'primary-links', )); $handler->override_option('tab_options', array( 'type' => 'none', 'title' => '', 'description' => '', 'weight' => 0, 'name' => 'navigation', ));
12) The Frontpage "River" of posts
The default way for you to assign posts allows you to specify how many most recent posts appear in the front page.
Admin | Content Management | Post settings | "Number of posts on the main page"
As you specify, the "river" of posts will stream through your frontpages, showing the most recent pieces of content available to visitors and users.
View for a Logged-in Admin User
View for a Public User
13) Setting up Ubercart
The configurations you'll be using in your Ubercart module depend on the payment methods and gateway you'll accept. Typically a PayPal account will work for a startup or smaller organization. If you choose to accept credit card numbers on your site, using Authorize.net, for example, you'll need to take additional steps to secure the site through SSL certificate and some additional considerations (search the Ubercart forums for more information on securing your site).
Ubercart Store Administration is here:
There are many overall features within Ubercart that I recommend you take an afternoon, a week or two (or more) to understand. Here is the user guide: Ubercart User's Guide
For the purposes of our membership site, we are focused on the payments and the checkout.
To gain an overview of general payment settings on your membership site, visit the "Payment Settings Overview" section:
Admin | Store Administration | Configuration | Payment Settings | Overview
To configure your payment, such as the PayPal e-mail to accept payments, configure the "Payment Methods"
Admin | Store Administration | Configuration | Payment Settings | Edit | Payment Methods
14) From the User's Perspective: Purchasing a Membership
From the user's perspective, they are either a logged-in authenticated user (and they may also have an additional role on your site) or they are an anonymous visitor, and they see the product you created in step 6 above.
Here's a sample of a visitor purchasing the "Membership" product - this is an annual membership as a paid member of the site.
Add to Cart
Here, the visitor has added the product to their cart. They are ready to checkout.
Here is the visitor, Jane Doe, and the information related to purchasing the annual membership. Note that in the permissions we've said that any kind of user of the site (at any role level) can create a new order, like Jane is doing today.
There is an additional checkout review page to check the details, prior to making the payment.
Making the Payment
Jane is certain she wants this membership and is now sent to PayPal (our specified payment gateway) to make her payment. Upon receipt, she'll get a PayPal receipt as well as a receipt from our website.
Additional Checkout Configurations
Note that you as the site administrator/builder can choose from many different combinations of options for handling the checkout process. Some variables that are available include: enabling anonymous checkout, hiding shipping information, using collapsing checkout panes, sending new customers a separate e-mail with account details, etc.
You may manage these configurations here:
15) From the Store Owner's Perspective: Tracking Orders
There are feature-rich reports available through your Ubercart installation. Included is a list of all the orders:
Admin | Store administration | Orders
Notice that you can use this orders feature, in conjunction with your existing users list, to gain good understanding of who is on your website.
Admin | User management | Users | List
Note our newest user, Jane Doe, who just recently purchased her annual membership to our community website and was promoted to paid member.
16) Membership by Role Determines Access to Content
Remember our permissions grid? Now that you've specified which user roles have access to which content types, the Drupal system automatically matches to the logged-in user and shows them the content that is available to them. In this case, paid members may add blog posts, forum posts, and stories.
Here is what user janedoe can access when she logs into our community site. Notice that only blogs, forums, and stories are available for her if she chooses to "create content" from her members-only navigation menu.
17) Members may Add Content
Jane Doe, who is now paid up for the next year, chooses to log in and create her own content, in this case, a new blog entry.
18) Updated Homepage
The new content created by your paid members now shows up in the "river" of posts, if you have specified that that content may be published automatically.
Note that if you choose to add an additional level of moderation, such as "hold for moderation," you can use the "Trigger" module to send an e-mail notification to the administrator when a new item is posted, and then "Rules" to allow that unpublished content to go live upon a certain action or additional moderation steps. User's guide to using Rules: Rule Based Action Execution (Drupal 6/7)
19) Flagging by your Users
The flags that you created as an administrator are now available to your logged-in users, pre-determined from the site specifications and organized through permissions and the "Flag" administration.
In this case, there exists a "bookmarks" kind of flag. Youu may specify your own flags, as well as if they are global flags or user-specific flags. "Bookmarks" or "Add to wishlist" are user-specific flags; but "Mark as inoffensive" might be a global flag that you set up to trigger action from an administrator.
Here is where you may administer your flags:
Admin | Site building | Flags
Here is the item recently bookmarked: notice the status message below: "This post has been added to your bookmarks."
Here is the default view of existing bookmarks - accessible through the user's menu or from their account details page. You may edit this view, if desired: for example, you may want to add the image thumbnail, a link to send a private message to the author, or other information about each bookmarked node.
20) Tying it all Together with a Theme
Now that you have a lot of the functionality working, you can work with your designer or use a theme (pre-built or uniquely customized) to add some nice graphics to the site.
You'll usually want to store your theme folder in /sites/all/themes/*
On the admin side, you can select from available themes. Note that the Acquia distribution of Drupal comes with some very clean themes such as Acquia Marina and Acquia Slate.
The Final Display
You've now pulled together a community membership directory-type site, with User Membership on an annual dues-paying basis, online payment through PayPal, user points, private messaging, bookmarks, and a custom view of all members.
Here is what it looks like switched to the Acquia Marina Theme:
And, because we like the separation of styling and functionality, here is the same site switched to the Acquia Slate Theme: Drupal is great!
With all the available modules and documentation from Drupal, your ability to develop these kinds of complex sites, with high functionality and interactivity, is greatly enhanced. The bonus of Drupal's extensive user community means you can ask questions and find answers in a relatively tight timeframe (check the search engines and Read the Manual First).
We have not even touched on some of the other fine ways that are available to you and your client to extend the site using open source community-contributed modules.
Ideas include Facebook Connect (connecting to your Drupal site using an existing Facebook login), Gmap Module (attaching map locations to your content), Ubercart Marketplace (allow your users to sell their own items through your online catalog), Organic Groups (allow private Ning-style networking), Five-star ratings (allow ratings on nodes), Aggregators (to collect RSS feeds from other sites and publish them as a resource on your site), and literally hundreds of other options to increase your site's functionality.
If you have additional ideas on membership-oriented community-building sites, please feel free to list them in the comments.