Drupal one Module after another
I have recently the need of updated a community website for an IEEE committee with the aim of strengthening the interaction among members and easing the dissemination of the activities on the domain. I've evaluated some content management systems like Word Press, Joomla and Drupal and then picked the last one because it seemed the one with the best extensibility capabilities. In particular there was one feature that I was not able to configure with the other two even by means of additional modules: defining additional fields for the registered user with the option of making some of these fields editable only by the administrator.
At this stage I've found that Drupal 7 is providing any function I need, and if, after a look at the configuration, something is missing there is a module that provides the required functionality.
The aim of this post is to provide an idea of the adopted modules and how they can help other people configuring a Drupal website. You can also check if the proposed module are being used by others looking at module usage statistics.
For the user login and registration I wanted to support the use of the email address, and then email address verification at registration. LoginToboggan modules comes handy. When the user account is being activated by means of the email verification I have to send an email to another service in behalf of the user. In this case the Rules modules provides the required flexibility allowing to associate actions to generic events in the system.
The login phase requires a specific mention. By default reserved pages provide an Access Denied message. This text can be customized using CustomError (not yet for D7!) alternatively it can be automatically redirected to the login page with 403Login module. This does not mean that the user is redirected to the originating page. This operation requires another module called Login Destination that accepts
As mentioned above I had to define custom fields associated to users. This feature is provided by the Profile2 module that allows to define new Profile Types that can be attached to the users. Each type is made by a list of fields, and each type can be associated with Permissions that describe who can read and modify the properties. In particular this last possibility allows the Administrator to specify organizational fields like the role in the committee. While the login page as an absolute link /user/login the profile editing is expressed based on the user identifier e.g. /user/5/edit, while it could be useful to have a general "me" link. It is not possible to define an URL Alias based on Token
The Profile Types allow also to use the published information inside the Views that, in the content model of Drupal, are the equivalent of database queries in which it is possible customize the output. Views allows to create user search pages and user listing using the profile types fields as elements. As a side note the email of the user is not directly accessible and a submodule of Profile2 is required to map it as a real field. Unfortunately Profile Sync Email is not working perfectly. While waiting for a patch I have used a SQL statement for performing this synchronization: INSERT INTO field_data_field_email (entity_type,bundle,deleted,entity_id,revision_id,language,delta,field_email_email)
SELECT "profile2","tch_member",0,profile.pid,profile.pid,"und",0,users.mail AS field_email_email FROM users,profile WHERE users.uid=profile.uid AND profile.type = "tch_member"
ON DUPLICATE KEY UPDATE field_email_email=VALUES(field_email_email)
Although the View mechanism is cool it requires some clicks to configure it properly and I have also not yet found a clean way to have a searchable View that when is first shown provides only the forms. Currently it shows the results as if no filtering is applied.
A more relevant issue is instead the possibility of importing users and their properties in the system. In particular the Feeds module is quite interesting allowing to import user from various types of text files, but it has no knowledge of Profile Types and a plugin of the Feeds module aimed at supporting was not enough stable. Having the need of importing about 600 users I've used Python to manually insert the entries in the database: first I've imported the basic user information using Feeds, then exported the generated SQL tables and create the SQL commands to enter them. When I've performed this task I've discovered that in Drupal the fields of Content and Profile Types are managed by separate tables, one for every field, whatever the type is using it.
Regarding fields it is important to mention that Drupal adopts an incremental approach, this means that in the core installation only fundamental field types are supported. For example I've added Email, Link, Date and Location. A special mention is Entity Reference that allows to have fields containing references to other nodes, for example for describing an Award or Workshop connected to a Conference.
Voting: the basic Poll module allows to answer a poll with multiple choice, while there is no clear way to implement Nomination mechanism. For this I have used a new Profile2 type that is editable and visible only by the owner. If the Nominee has to be among the registered user a Node Reference type can be defined and proposed as a list or autocompletion. The result of the Nomination are presented by means of a View aggregating votes. Quite handy. There anyway an issue on the way user selection is presented: it has to be a reference to a User entity and not to the Profile2 entity containing full user details due to some error in Profile2.
What is else is missing? Some other modules:
- Content Access for supporting more granularity in page editing. Specific members of the committee should edit specific types of pages, e.g list of Conferences or Courses
- Path Auto for easily generating nice addresses from content
- Google Analytics for fast integration of tracking
- Zen for customizing the Theme
- Biblio and MathJax: the first for bibliography management, the second for nicely rendering equations inside the pages
- Token Filter: a filter in Drupal is a task that is applied to the main body of content and it allows in the basic version to strip HTML elements if needed. This specific filter allows to replace special text with content from the current user or session
Definitely it is an interesting way to build a complex website. The biggest shortcoming is that some low level operations in particular the transfer of information among fields or the import. In that cases some SQL manipulation is needed.
Updated: 22/02/2012 with Voting
Updated: 04/05/2012: the experience has been posted on Drupal Use Cases http://drupal.org/node/1560954
Comments