Jun 30 2015
Jun 30

Queries are the centerpiece of MySQL and they have high optimization potential (in conjunction with indexes). This is specially true for big databases (whatever big means). Modern PHP frameworks tend to execute dozens of queries. Thus, as a first step, it is required to know what the slow queries are. A built-in solution for that is the MySQL slow query log. This can either be activated in my.cnf or dynamically with the --slow_query_log option. In both cases, long_query_time should be reduced to an appropriate value. Most Linux distributions come up with a default value of 1 or more seconds. But this turns out too slow for web applications as you want to achieve an overall response time of a few hundreds of milliseconds. So depending on your needs of performance choose a value of 0.1 or 0.01 seconds.

SQL consists of 2 different types of queries: Those who belong to the Data definition language (DDL) and those who are working with data (Data manipulation language, DML). DDL queries have usually no performance implications. But there is an exception of this rule of thumb: ALTER TABLE statements can be very time-consuming, if a table contains millions of records and uses (unique) indexes. We will cover a practice in a minute. DML queries again can be divided into INSERT statements and other CRUD statements (SELECT, UPDATE and DELETE) on the other hand. Those statements can be optimized with several techniques. Most of this blog post will address this type of statement.

Optimizing ALTER TABLE statements

Imagine you have an accounts table with millions of records and you want to extend it with a field for a phone number. A direct execution of ALTER TABLE would certainly lead to major load. The trick is to avoid index ad-hoc re-calculation. Hence, we drop all indexes and copy the table to an extra table and perform structural changes there.

  1. Set innodb_buffer_pool_size appropriately (Be aware: For performing structural changes, a high buffer pool size can speed up things; Being live however, a high size will lead to memory shortages)
  2. (Optional) Backup the database
  3. Drop all indexes except primary key and foreign keys
    DROP index ...
  4. 4. Copy the table and apply structural changes. Use a similar name, for example with suffix '_new'.

    CREATE TABLE IF NOT EXISTS `Accounts_new`
      id` int(11) NOT NULL AUTO_INCREMENT,
      `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
      `city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
      PRIMARY KEY (`id`),
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
      ALTER TABLE `Accounts_new` ADD `phone` VARCHAR(255 ) NOT NULL;

  5. Copy data with INSERT INTO ... SELECT. Just select the columns that are used in the new table.
    INSERT INTO Accounts_new SELECT `id`, `email`,  `city`, null FROM Accounts;
  6. Rename the table. In case of used foreign keys disable the foreign key check.

    SET foreign_key_checks = 0;
      DROP TABLE Accounts;
      ALTER TABLE Accounts_new RENAME Accounts;
      SET foreign_key_checks = 1;

  7. Create all indexes including foreign keys.
    CREATE index ...

Two steps require major efforts. First, copying all the data to the new table will take some time; Second, rebuilding all indexes can last a long time (it depends on the number of indexes and whether they are unique or not).


Optimizing insertions

INSERT queries should be merged, if possible. A single query that creates 10 rows is faster than 10 sole queries. However, this technique has its limits, especially, if MySQL runs out of memory. If you want to import a whole database, then you can switch off some consistency checks, for example foreign_key_checks=0, unique_checks=0. Moreover, autocommit=0 can also help.


Optimizing SELECT statements

SELECT, UPDATE and DELETE statements have one thing in common: It is the way they filter results (with the WHERE clause). This can turn out as a complex task, especially for big tables. Big means tables having a row count from 100 000. Tables having more than one million rows should definitely be included into query optimization. For the sake of simplicity, we concentrate on SELECT queries. It is the most frequently used case anyway.


1) Use EXPLAIN

If you want to optimize your query, you should know how MySQL executes it. You can use EXPLAIN to get the query execution plan. With MySQL Version 5.6 it is possible to use explain for insert, update and delete statements.

EXPLAIN SELECT * FROM Users WHERE uid = 1;

The result contains several useful informations about the query:


column Description select_type Is the query a simple query (primary) or is it a compounded query (join or subquery)? type This is extremely important for joins or subqueries: How is this query joined? The best types are: const, ref, eq_ref. Worse types are: range, index, all. Attention: do not mix up index with ref/eq_ref! For further informations, please visit the MySQL docs. possible keys A list of indexes which could be used to optimize the speed of the query. key The used index key_len The length of the index. Shorter indexes tend to perform better. ref Which column is used for the index scan? rows Estimated number of rows that have to be compared with the filter criteria. This number should be as low as possible. extra Additional information about the query. Attention: Do not mix up Using index with ref/eq_ref!

MySQL docs: http://dev.mysql.com/doc/refman/5.0/en/explain-output.html

If the query is a simple query (i.e. no joins or subqueries are used), then EXPLAIN will return a single line where select_type is set to SIMPLE. To get a good performance, it is important to use an existing index. This is the case when type is equal to ref and possible_keys and key suggest an index.

If joins are used, the returned result will contain a line per table. Joining tables should always be done by a foreign key comparison. In this case the type of an EXPLAIN is eq_ref. Avoid to leave out foreign keys. Try to avoid joins on different attribute types, for instance a varchar field and an integer field. This will make MySQL do a lot of type conversions which is simply not good.


2) Use existing indexes

Indexes are ordered by (at least) an attribute by design. Thus, they can be applied to queries which are filtering by this attribute, either as exact filter (WHERE x = 'y') or as range query (WHERE timestamp >= 123). Indexes are not applicable if you use any function in the WHERE clause, for instance WHERE SUBSTR(name, 0, 4) = 'Alex'. The following list shows which WHERE clauses can be handled by indexes:

WHERE x = 'y' check.png

WHERE timestamp >= 123 check.png

WHERE timestamp BETWEEN 123 AND 456 check.png

WHERE name LIKE ('Ale%') check.png

WHERE name LIKE ('%Ale%') error.png

WHERE SUBSTR(name, 0, 4) = 'Alex' error.png

If you have more than one filter criterion in the query, your index should include all used columns as well. Imagine you have the following indexes: name_IDX, firstname_IDX, firstname_name_IDX and name_firstname_IDX. Then the query

# Using composite indexes
SELECT * FROM Users WHERE firstname = 'Alex' AND name = 'Saal'

... could be optimized with firstname_IDX, firstname_name_IDX but not with name_firstname_IDX because of the order of the columns! The order has to be the same in the query as well as in the index. It is like using a telephone book. A telephone book is ordered by last name, then by first name. It is much more easy to first look for all persons with the desired last name and have a list with only a few persons. It does not make sense at all to browse the whole telephone book looking for people with a wanted first name and then comparing the last name in step 2.

Keeping this image in mind: It is always good to have a selective index. You can use an index which includes a gender of a customer. But this reduces the data set only by a half. Instead, it is much more pleasant to have an index like e-mail address or a unique index like Social Security Number. Be selective! As a rule of thumb, there are 3 levels of selectivity:

  • Primary key or unique key (best; those clauses will return a single row immediately)
  • An index matching the WHERE clause, or a prefix index (useful for text fields)
  • No key or index is applicable (worst)

Furthermore, firstname_name_IDX matches better than firstname_IDX and will be preferred by MySQL. Note that firstname_name_IDX can also be used for queries like

# Filtering the first name
SELECT * FROM Users WHERE firstname = 'Alex'

It is therefore neither necessary nor recommended having both indexes created simultaneously.

The indexes are always read from left to the right. If you have an index containing multiple columns - index names (column_firstname, column_familyname) - the order of your filters in the query should follow the same order. Otherwise the index can not be used. So if you filter without using the first column (column_firstname is not used in the query) in the index, but assuming that the filter is also used by just filtering for the second column (column_familyname) in the index, the index is not used. Therefore it is sometimes better to add a second index using just the second column. Check the statement by using EXPLAIN to check which index is used or not. For examples see the chapter about table indexes below.


3) Or Statements

The mysql query optimizer can not use indexes if the OR statement is used, so try to avoid OR statements!


4) Optimization of GROUP BY/ORDER BY queries

Sometimes you are facing queries that aggregate or sort rows:

# GROUP BY / ORDER BY
SELECT role, count(*) FROM Users WHERE registration_ts > 140000000 GROUP BY role;
SELECT id, username FROM Users WHERE registration_ts > 140000000 ORDER BY username;

What MySQL does is:

  1. Selection of Users by WHERE registration_ts > 140000000,
  2. Order results of step 1 (no matter if GROUP BY role or ORDER BY username is used)
  3. Projection to the desired columns by SELECT role or SELECT id, username

The hardest step is sorting. This is where indexes can help a lot. They contain a sorted list of records dependent to their definition. This is extremely helpful in particular if you have a lot of data in that table (Complexity of sorting algorithms is O(n*log(n))). How to define the index to optimize this query? Choose first the column filtered in the WHERE clause, then those in GROUP BY/ORDER BY (in the same order as in the query!). If it is possible to add the columns of SELECT to the index (after the columns of GROUP BY/ORDER BY) to gain some performance (this technique is called covering index). It is not always reasonable to use covering indexes: If the whole index gets too big, then you probably won't gain any time.

Extending the example of a telephone book: It is helpful, if you have requests like "Tell me how many persons have the last name 'Smith'" (This is a GROUP BY) or "Give me a list of all persons ordered by last name and first name" (ORDER BY).

In the previous example use the following indexes:

  • registration_role_IDX for the GROUP BY statement
  • registration_username_IDX for the ORDER BY statement

5) Usage of subqueries

When it comes to complex queries, MySQL (especially before 5.6) is optimized for using JOIN statements. However, in some cases a subquery can be more efficient if you use both GROUP BY and ORDER BY on different tables. In that case, an index cannot be used, if you join the tables. Defining a main query and subquery avoids this problem, as each query acts on its own table and is able to use any available index.

# Case A: Query as INNER JOIN
SELECT
    a.id AS account_id,
    p.id AS product_id,
    TRIM(SUBSTRING(p.name, 1, 30)) AS product_name,
    COUNT(*) AS count
FROM Accounts a
INNER JOIN Orders o ON a.id = o.account_id
INNER JOIN Products p ON p.id = o.product_id
GROUP BY p.id
ORDER BY a.id

# Case B: Subquery
SELECT account_id, product_id, product_name, count
FROM (SELECT
    a.id AS account_id,
    p.id AS product_id,
    TRIM(SUBSTRING(p.name, 1, 30)) AS product_name,
    COUNT(*) AS count
  FROM Accounts a
  INNER JOIN Orders o ON a.id = o.account_id
  INNER JOIN Products p ON p.id = o.product_id
  GROUP BY p.id) as product
ORDER BY account_id

In that case, the query has been split up to an outer query and a subquery (line 2-10). Case A would make MySQL create a temporary table and use filesort. Case B can avoid that. It depends on the size of each table, which way is superior.

Other MySQL blog posts

Jun 05 2015
Jun 05

Backups are very important for every application, especially if a lot of data is stored in your database. For a website with few updates it is not so important to do backups regularly, you can just take the backup of last week for restoring the site and if there was just one or two updates, you can add them manually afterwards. But if you run a community site with user generated content and a lot of input the topic backup & recovery becomes a lot more important but also complex. If the last backup is from last night you have to consider all the updates that were made in the meantime. Because you don’t know what the users have entered, it is impossible to add these changes afterwards manually. That is why you need a backup strategy that also considers the storing of all updates in the time between two full backups.

There are four methods for backup and recovery a MySQL database. All other methods are based on these 4 methods. These are logical and physically backup methods.

Physical backups

Storing the binary MySQL files

With this method the real MySQL database files for the tables, in which all data is physically stored on the hard disk, are copied to a save location. If a backup is needed the files can be copied back to the server.

Backup

service mysql stop;
cp -R /var/lib/mysql/database_name target
service mysql start;


Recovery

service mysql stop;
cp -R /path/to/backup/database_name /var/lib/mysql/database_name
service mysql start;

Advantages:

  • fast
  • easy for backup
  • multiple files, if one is broken, hopefully just this table is lost, not the whole database

Disadvantages:
  • takes a lot of diskspace, all the indexes etc. are copied too
  • The database has to switched off for a certain time during the backup
  • Restoring can become a little complex
  • you need special permissions on the operation system

LVM snapshot

Linux provides a Logical Volume Manager (LVM) (http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)) and is a layer to manage the filesystem. The LVM provides the ability to create snapshots of any logical volume. So, you create a backup of the physical volume which can be easily used for recovering in the future. This is one of the best and easiest solutions, it is very fast, very easy and the potntial error level is very low. You don't have to set your database or application offline, there will be no locks on the tables and you get a stable snapshot of the current status.

Backup # create the snapshot
lvcreate -l100%FREE -s -n mysql-backup /data/databases

# Create a mount-point and mount the volume/snapshot
mkdir -p /mnt/snapshot
mount /data/databases/mysql-backup /mnt/snapshot

# Do the backup and copy it to a separate system
tar -cf /tmp/dbbackup_YYYMMDD_H:i:s.tar /mnt/snapshot
cp /tmp/dbbackup_YYYMMDD_H:i:s.tar ip:/path/to/backups/

# Now remove the mount and the snapshot
umount /mnt/snapshot
lvremove /data/databases/mysql-backup


Recovery # copy back the backup to your server
cp ip:/path/to/backups/dbbackup_YYYMMDD_His.tar  /tmp/

# stop the database
service mysql stop;
# remove the old database files
rm -R /var/lib/mysql/database_name

# copy the backup
cp /tmp/dbbackup_YYYMMDD_His.tar .

# unpack the files
tar xvf dbbackup_YYYMMDD_His.tar

restart the database
service mysql start;

Advantages:

  • very fast
  • easy
  • no stop of the database, no lock on tables

Disadvantages:
  • LVM needed
  • maybe root access for the operation system needed

Logical backups

mysqldump

A mysql dump is a common strategy for backups. This is a logical backup, means the structure and the content of the database are exported into a special file in a special format. This is done by using the MySQL syntax and stores all relevant information’s that are needed to rebuild the database. Normally there is a statement to create the database again, statements to rebuild the tables and their structure and then statements to import the data into the tables itself. All these information’s are stored in one file and this can be copied to a save location. When a backup is needed the file can be imported and the database will be restored with the information’s stored in the file.

Backup

# create the dump
mysqldump --add-drop-database -u Username -pPassword database_name > dump_database_name_YYYMMDD_His.mysql


Recovery

# drop the old table and insert the backup dump data
mysql -u Username -pPassword database_name < dump_database_name_YYYMMDD_His.mysql


Advantages:
  • Very easy
  • Can be done by users without special permissions on the operation system, esp. root permissions
  • The indexes are not stored, so this backup does not uses as much disk space as a physical file backup
  • You can have a look into the backup and also search in it, data manipulation is also possible if something has to be changed

Disadvantages:
  • Slower than a physical backup
  • Slower in recovery, because everything has to be imported first and then the indexes have to be built again
  • One file, if this is broken the backup is not possible

Hints:

  • --lock-all-tables: locks all tables during creation of the dump, so the application cannot access them, avoids data inconsistences!
  • --single-transaction: the whole dump is executed as an transaction, so the application can still access and write the database, the dump is made via transaction
  • --master-data: set the location of the master in a database replication, so the slave knows the position and where to start with the replication
  • --add-drop-database: add a DROP DATABASE statement before each CREATE DATABASE statement

Innobackup

There are special tools to create a innobackup, see also http://dev.mysql.com/doc/mysql-enterprise-backup/3.8/en/ihb-meb-compatib....
This is a special case for databases where the storage engine innodb is used. As innodb became the default storage engine and mysisam will be removed in the future, this is also a very common possibility to create a database backup. It is nearly the same as a normal MySQL dump but also considers the special possibilities of innodb like foreign key constraints etc. There is the MySQL Enterprise Backup (MEB) (http://www.mysql.com/products/enterprise/backup.html) for creating innobackups, but it costs money.

There is also an open source tool from percona named xtrabackup - http://www.percona.com/software/percona-xtrabackup. There is a free version available but also a enterprise edition which also costs money. As percona (http://www.percona.com) offers a lot of useful tools around mysql, this is maybe also a good choice for your MySQL toolkit. There are also other tools from percona which help to improve you daily live with MySQL.

Hints

Master-Slave replication for backups and avoiding downtimes

A special hint at this point: if possible, use a master-slave replication and use the slave for building the backups, so the main system if not affected and performance for the application is not affected. It is also a good setup to avoid long downtimes of your application. If one server crashes you can switch to the other with your application and it will stay online. In the meantime you can repair the broken system and then restore the old setup. So, if the master breaks, you can switch to the salve and it becomes master. If the slave fails, just the read requests of your application have to be routed to the master.

Fromdual Bman

Fromdual.com offers the tool fromdual_bman (http://fromdual.com/mysql-backup-manager-mysql_bman) which is a wrapper for seven different backup methods (the ones mentioned above and combinations of them).

Backup location

A backup is always better than no backup. But if the backup is stored on the same logical disk on the server where your website also runs on, you mabe get in trouble. If the disk crashes your website is offline and you also loose your backup. In this case it is impossible to restore your website on another server and bring it back online. So, always save your backups on another logical volume or on another server. If the data is very important also consider to save your backups on multiple locations maybe also in other data centers. In a case of fire or something similar your backup can be fetched from somewhere else and recovery can run in another data center.

Uuuups Queries - Accident on database

So called uuuups queries are queries where accidentially a wrong query was executed in a production system. This mostly happens because somebody executes the query manually by accident. There are multiple reasons why this can happen, for example mixing up the consoles etc.

Time is the key, so you have to act immediately!

Stop the database and your application immediately! Set your application to maintenance mode!

Two possibilities:
  1. no database replication

    You can only reimport the last backup, whenever it was made. Hopefully it was made not long time ago, maybe last night. By this you loose all changes between your last backup and the time of your uuuups query. Or, if you know the changes that were made in this time, you can fix the changes manually or by writing a script which does the changes for you.

  2. a running database replication
    You can reimport the last backup. By using a replication you automatically get the binary logs where MySQL writes the databases changes to be executed on the slave server. You can use these binary logs to create a point in time recovery, that means you can recover everything until the execution of the wrong query. After the import of the dump you can execute the mysql binary logs containing either the statements (statement based replication) or the changed rows (row based replication). Because all the changes are stored in these files you get all the changes that were made in the time of your last backup and the time the uuups query was executed. Do not forget to avoid the execution of the uuups query again, it is also in the binary logs! You can edit the binary logs by using the myqlbinlog tool (http://dev.mysql.com/doc/refman/5.0/en/mysqlbinlog.html) and delete the uuups query from the log. This has to be done on both servers, on the master and on the slave. But when one of the servers (use the master first) is recovered you can enable you application again by just using this first server. After that you can recover the slave server and restart the replication. If you are an experienced user you can also start the recovering of the master and the slave server together, so both systems are nearly back at the same time. But so not mix up the systems, else you have to start from the beginning and your application stays offline.

We hope these hints can help you in your daily life with MySQL. There are also other posts about MySQL. Because in this post there was a lot about database replication mentioned, the post about MySQL - setup is also interesting for you.

Other MySQL blog posts

May 12 2015
May 12

When setting up a MySQL Server there are a lot of things to consider. Most requirements depend on the intended usage of the system.

Beginning with the hardware requirements, this series of blogposts consists of our own experience, operating several hundred MySQL instances as well as a recent workshop our team attended. Before you now start optimizing your MySQL instance, consider the following: Standards are more important in multi-instance setups than individual performance tuning. Standards allow for easier debugging and give you a better handling for security related incidents. We strongly recommend the use of configuration management tools, like puppet or Chef for environments that are supposed to be consistent over all your systems.

The MySQL default settings, as of version 5.6 are great - and apart from larger systems, hardly any changes are necessary. For a standard LAMP stack, hosting a blog or a small website, not a lot of optimization is needed. Todays CMS come with sufficient configurations and tampering with the back end itself can cause more harm than it will help optimizing performance. These articles are mostly interesting, if you are developing your own applications. This first article focuses on the design of the underlying platform. It makes an estimated 10%-20% of the possible performance tuning. Nevertheless, if your application is poorly designed or it is not optimized, it will become quite expensive to try and fix the system the hardware-way. So, the first step is always to ensure a well structured and optimized application. We will address this in a future article.


Hardware / Operation system

Here are some general hardware considerations, viable for most setups:

CPU

MySQL does NOT scale a single query to multi-cores. (one query = one core). So it is better for your instance to have less - but faster - cores than vice versa. Try to avoid multi-CPU (note: multiple physical CPU, not cores), systems with a lot of ram. Usually CPU's have a direct bus to their RAM-banks. If RAM on a bank held be another CPU needs to be addressed, there will be overhead. In high performance setups rather go for a hexa- or octa-core than two quad-core CPU.

RAM

RAM has become a cheap resource these days. Use as much RAM as possible but it should match the database-size and have some extra space for the operating system and the application if existent on the same machine. If the database is served mostly or completely from RAM, it tends to have fast read speeds and only needs to write to disk, not to read from them, in most cases. This will be a very huge performance optimization, because operations in the RAM are easily 100 times faster than an SSD.

HDD

If you are using conventional, magnetic storage, faster turning disks are preferred. Try to go for 15k/RPM+. SSD or solid state drives are obviously even better than that and outperform every other storage medium at random IOPS (input output per seconds). For the RAID setup, go for RAID10 (better) or RAID1 (cheaper) but avoid RAID5/6 etc because the performance is bad at random writes. The less read/write operations from disk the better the performance.

File system

If you are not sure about the file system, go with the recommended type of your operating system. In general that means: Stay with ext4. In the very unlikely event of file system problem, the most common will make debugging a lot easier and in the long term, this outweighs the possible performance gain of other file systems by far.

I/O scheduler

The standard scheduler on a lot of operation systems is CFQ (Completely Fair Queuing). For databases, consider switching to NOOP or Deadline. Find out the scheduler your system is using

cat /sys/block/sda/queue/scheduler

This will give you an output like

noop [deadline] cfq

where the used scheduler is shown in brackets. As of kernel 2.6.10 it is possible to change the scheduler at runtime. You will need root permissions to do so.

echo noop > /sys/block/sda/queue/scheduler

to set your scheduler to noop. This setting is not persistent and will be reset at reboot. To make a setting permanent, it needs to be given to the kernel as a parameter at boot time.

elevator=<scheduler>

needs to be added, where <scheduler> needs to be noop or deadline.


Storage engine

If starting a new database, especially with MySQL 5.6, InnoDB will be be the standard engine. For already running projects, there is a way to convert MyISAM tables to InnoDB. This is usually not recommended as the performance gain will only impact very high performance databases and there is always a risk involved.

General Setup

Operation system

The decision for the operation system is one of the less important. At Cocomore we stay with the Ubuntu LTS versions. As mentioned in the beginning, systems that are setup the same way make configuration and debugging way easier and improve stability. The problem with LTS systems is that they oftentimes only offer relatively old packages. The default on Ubuntu 14.04, released in April 2014 is MySQL 5,5.

There are a couple of ways to install newer versions. As of February 2015, the newest stable MySQL version ist 5.6. This can be installed from the Ubuntu universe repository. Oracle themselves offer a repository for MySQL as well, you might need to login first, though. We recommend using the latest stable release, as of February 2015, this is version 5.6.


Database Replication

There are two possibilities:
  • statement based - In MySQL 5.1.4 and earlier, binary logging and replication used this format exclusively.
  • row based

Statement based replication stores the SQL statement in the binary log and will be executed on the slave server. This has the disadvantage that for example time updates etc. will also be executed as said within the statement. Because of this, there is a chance of inconsistency between Master and slave because the time or random statement will lead to different results on the different servers.

Row base replication is superior because only the results of a statement (the changed rows), will be stored in the binary logs and then the appropriate rows will be changed to the new result on the slave. But this requires much more disk space, because now not just the sql statement is stored any more but the whole rows which are changed.

The replication method can be changed on the fly, but we recommend the row based replication to avoid inconsistency between Master and Slave. Diskspace became very cheap, so there is no need to use the statement based replication.

As of MySQL 5.1.8, the server can change the binary logging format in real time according to the type of event using mixed-format logging. When the mixed format is in effect, statement-based logging is used by default, but automatically switches to row-based logging in particular cases.

High availability solutions

If your database goes down, your application will not work anymore. Therefore we recommend a high availability setup for your system if your application should stay online although there are some troubles in the background. There are some possibilities to ensure high availability for your database. The simple ones are easier and less expensive as an gallera cluster for example. It depends on the worth of your application how mush time and mone you want to spend to keep your application always online.


Master - Slave setup

  • sell also Master - Slave setup
  • simple asynchronous replication
  • in case of failure, switch to the slave and recover the master
  • switching can be done manually or automatically for example using Heartbeat

Active / passive cluster

  • same as before using a master - slave replication
  • using a vitual IP address which points to the master
  • underlying system is a SAN or DRBD
  • Heartbeat is switching the virtual IP address to the other system (slave) in case of error

mysql_ha_active_passive_cluster.jpg

Gallera cluster

  • see also Gallera cluster
  • Gallera is a cluster system of multiple environments with multiple masters which are all synchronized
  • there is a load-balancer switching the load to the different master databases
  • Gallera is synchronizing the multiple master databases, if statements are executed
  • works as long as the majority of the masters is online and connected to Gallera, therefore it has to be always an odd-numbered amount of Master databases
  • If one Master db crashes the others are still online and the crashed one can be repaired

mysql_ha_gallera_cluster.jpg

Conclusion

The first step for optimization is always your application itself. But there are also other possibilities to tune up your system by choosing the right hardware, the right operations system (OS), the correct file system and the best storage engine of MySQL itself for your application. With newer MySQL Versions new features but also performance improvements are delivered. Currently MySQL Version 5.6 (February 2015) is a very good way to deal with.

To ensure that your application is not going down if your database goes down there are possibilities to ensure high availability using database replications and different setups. It depends on your budget which solutions can be used, but always consider all possibilities of improvements (Hardware, DB tuning, replication or application tuning) and the estimated effect, so you can choose the improvement with the best cost-value ratio.

If you have questions or you need help with your application, please do not hesitate to contact us.

In our next post we will provide you some informations how to improve your MySQL settings in the my.cnf itself.

Other MySQL blog posts

Oct 09 2014
Oct 09

Field collections is a nice contributed module that extends the default Drupal entity functionality by creating a new entity field that can be composed by other fields. With this module we solve problems like creating complex entities where we want to store multiple different values into one single field. This works because Drupal lets us assign unlimited values for a field, which links to the field collection entity where we have multiple fields, thats how we "grouped" multiple fields into one field.

At a basic usage, field collections is not difficult to add to our entity, but when we want to do some advanced stuff, this module can be very complex. Here I will show how to do some magic with it, programatically.

Obtain the values of the child fields

How to access the field collection values of an entity? Field collections store field collection items, which are the values of this kind of field. The field collection items use an ID, and with this ID we can find other fields. It also defines a new entity type called “field_collection_item”.

  1. Access to all values of a field collection on an existing entity, using Field API // Get the items of a field collection, from a node
    $field_node_example_values = field_get_items('node', $node, 'field_node_example');

    // Use a field collection helper function to get all the field collection item ids
    $field_node_example_ids = field_collection_field_item_to_ids($field_node_example_values);
    // By default, Drupal don't load the field collection items
    $field_node_example_fc_items = field_collection_item_load_multiple($field_node_example_ids);

    // Loop over every field collection item and get the values for each field
    foreach ( field_node_example_fc_items as $item) {
        $fc_field_values = field_get_items('field_collection_item', $item, 'field_inside_fc');
    }

  2. Access to all values of a field collection on an existing entity, using an entity wrapper

    $node_wrapper = entity_metadata_wrapper('node', $nid);
    // Loop over the collections until we find which we have to modify
    foreach ($node_wrapper->field_example->value() as $field_example_value) {
       // Wrap it with Entity API
       $fc_wrapper = entity_metadata_wrapper('field_collection_item', $field_example_value);
       $fc_field_value = $fc_wrapper->field_example_child->value();
    }

Alter the child fields

Now let's see how we can modify or remove items from an existing field collection of an entity. To do things easily, I prefer to use here an entity wrapper.

  1. Alter the value of one of the fields of a concrete field collection item $fc_item = field_collection_item_load($item_id);

    // Check there's no problem with the item
    if (!$fc_item) {
      return;
    }

    // Wrap it before modifying
    $fc_item_wrapper = entity_metadata_wrapper('field_collection_item', $fc_item);
    $field_value = $fc_item_wrapper->field_example->value();
       ... change $field_value ...
    $fc_item_wrapper->field_example->set($field_value);
    $fc_item_wrapper->save();

  2. Delete a field collection item

    $fc_item_wrapper = entity_metadata_wrapper('field_collection_item', $item_id);
    $fc_item_wrapper->delete();

Create a field_collection_item

Field collection items use a “entity host”, which is the entity to whom the field collection is attached. To add a new field collection item to an existing field collection field, we have to create it and set its entity host, then we can assing values to every single field of the field collection item and save it.

// Create a field_collection_item entity
$fc_item = entity_create('field_collection_item', array('field_name' => 'field_example_is_a_field_collection'));

// Attach it to the node
$fc_item->setHostEntity('node', $node);

// Check there's no problem with the item
if (!$fc_item) {
  return;
}

// Wrap it with Entity API
$fc_item_wrapper = entity_metadata_wrapper('field_collection_item', $fc_item);

// Assign values to its fields
foreach($fc_item_values as $field_name => $field_value){
  $fc_item_wrapper->$field_name->set($field_value);
}

$fc_item_wrapper->save();


Alter a field_collection field into a form

When we are creating or editing a node (or any other entity) we use a form, and to modify it usually the hook_form_alter is used. Here are some interesting examples of how to alter the field collection widget.

  1. Change the options for a select box on all the field collection items and don't display the remove button for the first item. $field_name = 'field_collection_example';
    $fp_langcode = $form[$field_name]['#language'];
    $options = array( … );
    foreach (element_children($form[$field_name][$fp_langcode]) as $child) {
      // All the unlimited values fields have the “Add more” button as a child, but it's not a field collection item
      if (is_numeric($child)) {
        $form[$field_name][$fp_langcode][$child]['field_selectable'][$fp_langcode]['#options'] = $options;

        // Don't display the remove button for the first field collection item
        if ($child == 0) {
          unset($form[$field_name][$fp_langcode][$child]['remove_button']);
        }
      }
    }

  2. The field collection field stores some state information about it on $form_state. With this information we can know, realtime, how many items we have on the form and take decisions about it. For example, we have an unlimited values field collection field, but we want to limit the number of items depending on some certain circunstances. With this example, we can control a field to not display more than 3 field collection items on the form. $field_name = 'field_collection_example';
    $fp_langcode = $form[$field_name]['#language'];

    // Get state information about this field
    $fp_parents = $form[$field_name][$fp_langcode]['#field_parents'];
    $field_state = field_form_get_state($fp_parents, $field_name, $fp_langcode, $form_state);

    // The field state will change everytime we click on “Add more”, after the ajax call is triggered and the form is re-rendered to display the changes.

    // The user can see a maximum of 3 field collection items
    $items_limit = 3;
    if ($field_state['items_count'] < $items_limit) {
      // I want to change the “Add more” button title
      $form[$field_name][$fp_langcode]['add_more']['#value'] = t('Add another');
    }
    else {
      unset($form[$field_name][$fp_langcode]['add_more']);
    }

Clone field_collections from an existing node to a new node

Finally, here is an example of how to assign some default values to a field collection on a node creation form. As you can suspect, this is tricky if the value to clone is only one field collection item, but if we want to clone more than one, it's a problem because Drupal by default will only provide the form widget to enter the first item values (and wait for you to click on “Add more”).

The technique is to reproduce what Drupal does when the Field API attaches the fields to the node form. Using this way, Drupal will provide all the form structure we need to see all the values that come from the node we want to use as origin, but this has a problem and is that doing it this way we are assigning the same field collection items to two different nodes and if one of the nodes changes the values of one of the items, this will be reflected on the other node. The solution is to reset the item_id and revision_id values for the items on the new node, so we get the default values we want and they will be stored as new field collection items attached to the new node.

    $original_node = node_load(123);
    $node_type = 'my_custom_type';
   
    // Get the fields defined for this node type;
    $node_fields =  field_info_instances('node', $node_type);

    // Re-create the fields for the original node, like when editing it
    $tmpform = array();
    $tmpform['#node'] = $original_node;
    $tmpform['type']['#value'] = $node_type;
    $tmpform_state = array( 'build_info' => array('form_id' => $form['#form_id']) );
    field_attach_form('node', $original_node, $tmpform, $tmpform_state, entity_language('node', $original_node));

    // Here we have on $tmpform the form structure we need and with the default values.
    // We can choose what fields to clone, but in this example we will loop over all the node fields and clone all of them
    foreach($node_fields as $field_name => $field_settings) {
      // Copy the form structure
      $form[$field_name] = $tmpform[$field_name];
      // Copy state information about this field
      $form_state['field'][$field_name] = $tmpform_state['field'][$field_name];

      // When copying the field_collection structure, reset the id of the entities and
      // they will be created again with a new id.
      $langcode = field_language('node', $original_node, $field_name);
      if ($form_state['field'][$field_name][$langcode]['field']['type'] == 'field_collection') {
        $field_childs = &$form_state['field'][$field_name][$langcode]['entity'];
        foreach(element_children($field_childs) as $idx => $fc_entity) {
          $field_childs[$idx]->item_id = NULL;
          $field_childs[$idx]->revision_id = NULL;
        }
      }
   }

Apr 01 2014
Apr 01

The last week three of us from Cocomore went to the little town of Szeged in Hungary, around 175km south east of Budapest.

The DevDays were all about developing Drupal 8 further and enhance drupal.org. The only topic was contributing to Drupal in the one way or the other. Whatever you are, either a developer, a themer, a site builder, a devop or a business man, everyone has his/her part in this amazing community and everyone found a spot where he/she could help to foster Drupal further.

GroupPhoto

All the week there were sprints and mentors around if you needed to get started and from Thursday till Saturday there were a lot of very interesting sessions. While the Cons are heading more and more to be business orientated lately and the camps are mostly for the local communities, the DevDays are a community event, where everything centers on contributing. Core committers around the world joined this event and some received a scholarship, so that they had the opportunity to be there, too.

It was a very successful and exhausting week for all of us. We had a great time, met a lot of people and for sure had the one or other drink with them. A lot of things got done. Drupal 8 is now a big step further to becoming a beta and drupal.org will have a responsive design. Much of work for that was done in this particular week. And all of this couldn't have happened without the outstanding work of the organization team. So a very big kudos to them!

Organization Team

And now get some good impressions of all the stuff in form of some cool pictures and tweets from the last week by Gábor Hojtsy

[embedded content]

Also don't miss out of the Drupalfolk Song!

[embedded content]

Drupalfolk from Rafa Terrero on Vimeo.

Thanks to everyone who made this happen and everyone who attended the week, which made this time just so amazing!

See you all next year again at the next DrupalDevDays, where ever they will be or at any other upcoming DrupalCamps (like Frankfurt, add Spain here?) or Cons (like Amsterdam).

Jan 17 2014
Jan 17

[embedded content]

The Internationalization Tag Set 2.0 has now the status of an official W3C-recommendation. Cocomore participated in the development of this standard for encoding information that increases the quality and efficiency of translation and internationalization on the web. Within the EU sponsored LT-Web project we did not only contribute to the standard. We also created a number of reference implementations that put it into practice and demonstrate its benefits. A lot more detail on what we did in the project can be found in the official project deliverables that are now online (we were responsible for D3.1.1, D3.1.5, D5.1.1). Below are short summaries.

Drupal Modules

Within D3.1.1 of the MultilingualWeb-LT project Cocomore implemented modules for translation and ITS2.0 handling within the open-source CMS Drupal. The implementations are based on the translation management (TMGMT) module available for Drupal as a community module (https://drupal.org/project/tmgmt). The implementations provide the following functionality:
  • Base TMGMT module models translation workflow with external LSPs in Drupal
  • Cocomore’s extensions added the following abilities:
    • Handle ITS 2.0 throughout the whole workflow
    • Apply global ITS 2.0 metadata at content node level
    • Handle ITS 2.0 annotation in Drupal WYSIWYG-editors (where content is produced). Annotation via menu bar, context menu, keyboard shortcuts.
    • Standalone ITS 2.0 editor (jquery Plugin) to support annotation in a separate process step, without modifying the actual content. Annotation via menu bar, context menu, keyboard shortcuts.
    • Localization chain interface: Round-tripping of data to/from LSP‘s TMS, including automatic data export and re-import
    • Interface with Enrycher for automatic annotation
These functionalities are embodied in the following modules:
  • Drupal TMGMT Workflow (TMGMT-module extension) to allow workflows with ITS 2.0 annotation
  • Drupal WYSIWYG editor: Plugin for ITS 2.0 annotation
  • Drupal TMGMT Translator Linguaserve: Localization chain interface (see also D3.2.2 and D4.1.3)
  • JQuery plugin for ITS 2.0 annotation in a separate step (new implementation)
  • Drupal Enrycher Integration (see also D3.1.3)
The modules are released under GNU General Public License 2 and can be downloaded and modified. They are available at the following URLs:

ITS 2.0+CMS: Best Practices

One important application for ITS 2.0 is the preparation of web content within a CMS for optimized localization/translation. This is best done by implementing ITS 2.0 directly inside a CMS. The experiences gathered in this context within the MultilingualWeb-LT project are summarized in a best practice documentation published as D3.1.5. It discusses topics that occur when using ITS 2.0 in connection with a CMS, and suggests ways to deal with these topics. The document is informed by the experiences gathered in the MultilingualWeb-LT project, where an ITS 2.0 aware translation workflow was implemented within the open source CMS Drupal. Its aim however is to provide guidance independent of the CMS as far as possible. An important aspect are therefore the characteristics of the CMS that interact with ITS usage and handling. However, not all internationalization-related issues can be resolved by the special markup described in ITS 2.0. The best practices in this document therefore go beyond application of ITS markup to address a number of problems that can be avoided by correctly designing the XML format, and by applying a few additional guidelines when developing content. This document and Internationalization Tag Set (ITS) Version 2.0 implement requirements formulated in the W3C Working Draft Requirements for Internationalization Tag Set (ITS) 2.0.

Drupal Machine Translation Training Module

Within D5.1.1 of the MultilingualWeb-LT project Cocomore implemented a module to send aligned original and translated data with ITS 2.0 markup to a machine translation (MT) provider for data driven creation or optimization of machine translation engines or models. The most common use case will be to train or tune a statistical MT model based on the aligned data and give special consideration on top of the standard techniques to the knowledge that is encoded in the ITS 2.0 markup. But other use cases, like the systematic identification of problematic cases for manual adjustment of a rule based MT system are also conceivable.. While ITS aware MT training was explored in more detail in D 5.2, the scope of this deliverable is the extraction of annotated and aligned bilingual data from the Drupal CMS. This process is based on the ITS 2.0 capabilities added to Drupal as described in the deliverables for WP 3. It was successfully tested in the context of the business case described in these deliverables (translation of VDMA press releases). Based on 141 press releases that were translated from German to French and Chinese. we could provide a three-way parallel annotated corpus of some 12.000 sentences.
Nov 19 2013
Nov 19

Christian Lopez (Penyaskito) representing Drupal in the EBE13 CMS round table.

Penyaskito, aka Christian Lopez, Drupal developer at CocomoreThis past weekend was a busy one for some of our developers who attended EBE13, a major Spanish conference for digital marketing, blogging, social media, and online communication, held annually in Seville, not far from our Cocomore in Spain, which drew over 1000 developers this year. Christian Lopez (aka Penyaskito on Drupal.org and Twitter), participated as an expert panelist representing Drupal in a "round table" moderated debate, lending much credibility to our favorite popular open-source CMS and Web application framework. He spoke about typical use cases for Drupal, as well as some unusual places he has seen Drupal in action, such as in a POS system in McDonalds, among other odd uses. He was joined by Isidro Baquero, representing Joomla, and Rafael Poveda, representing Wordpress. The debate was moderated by Agile trainer and coach, Jeronimo Palacios.

What they learned was that, in the end, everyone who actively contributes to open-source is a winner, regardless of the technology! The benefits of being a part of a great open-source community turned out to be the most compelling reason for using each of these projects. Of course there are other strong reasons we, at Cocomore, favor Drupal, but involvement with a greater development community is a good way to become an expert in the CMS you use. So if you work with Drupal (or Wordpress or Joomla or any other open-source CMS), finding ways to contribute will help you grow as well as improving the code base that you use.

Jun 14 2013
Jun 14

The people who use any given web site are all different in terms of geography, past behavior, intent, device, time of day, the temperature of the climate they’re currently in…and the list goes on. Developing for the web is anything but easy, so, over the last few years, the Drupal community has been focusing on keeping up with the various mobile device sizes, design patterns and browser technologies, putting a lot of attention on responsive design, and doing it well. So, we’ve since been doing fairly well on adapting to various devices, but what about the aforementioned traits such as intent, past behavior and the like?

We often create personas to plan and design web sites, but the content does not embody or respond to these fictional-turned-real characters. Marketers spend a lot of time producing content that could be better-tailored to each individual. An individual’s browsing history can be cookied, if they are an anonymous user, or logged in analytics and tied to their account as an authenticated user.

Amazon.com has been a leader in this domain. Just look at all the recommendations and custom-tailored content you receive when logged in to amazon.com. The site even informs the anonymous, uncookied user when there is no browsing history to act upon, encouraging further activity on the site.

Amazon.com with no browsing history

Think about a woman in her late 60s – based purely on statistics, she might opt-out if she receives an email that contains offers for power tools and pro athlete products. Or a man who receives an email with women’s clothing. Similar consequences are in play on web sites.

Another example of a leader in context is Netflix. New videos are recommended based on your viewing habits, ratings, and even your Facebook friends’ activity on Netflix.

Screen Shot 2013-06-14 at 4.39.50 PM

The buzzword for this context is called Web Experience Management (WEM). Vendors have been developing proprietary, expensive, closed-source solutions. It is to the great benefit of the Drupal community to engage in WEM as part of What Drupal Does. There is already work being done with the WEM project that allows one to track user events as they occur throughout the site. By so doing, one can customize a user’s experience so that it is unique and relevant to the user. The WEM module also integrates with Google Analytics to further track events. Any event you track in WEM can also be sent to Google Analytics.

Events are tracked via the included  Engagement API. You can track an event via PHP on your page or during a certain hook in a custom module. The PHP would look something like this:

engagement_event_track($event_name, $event_value, $event_data, $uid);

An event can also be tracked via Javascript, like so:

Drupal.engagement.track(event_type, val, data)

An event can also be tracked via HTML, such as in an HTML email.

The WEM project is currently under active development, but already usable. It needs people to help with integration into Views, Rules, and similar Drupal architecture patterns. With that, let’s close with a few screen shots of the WEM module in action, running on on Drupal 7. One can see that UI for assigning points to events within categories is simple yet effective. User segments can be built from these categories and corresponding point totals to deliver a customized, contextual experience to your user. This effort will hopefully make WEM much less of a concept of its own, and lead to the expectations of what Drupal does as a CMS. WEM is really just a CMS, with context.

Screen Shot 2013-06-12 at 3.33.41 PM Screen Shot 2013-06-12 at 3.34.33 PM Screen Shot 2013-06-12 at 3.34.44 PM

Web Experience Management: User interface in Drupal 7

Web Experience Management: User interface in Drupal 7

May 02 2013
May 02
Drupal 7 Features 2 screen

Drupal 7 Features 2 screen

Until we can override the enabled module/theme/library list dynamically in Drupal 8 via configuration, we can bundle up our environment-specific development modules and Strongarm variables in a feature and enable the feature on a per-environment basis in settings.php (or even better, local.settings.php) via a project called Environment Modules. For example, one could create a feature for the development environment, enable the devel module, and set environment-specific Strongarm variables such as those that leave Drupal core caching disabled or environment-specific settings for Domain Access domains. Additionally, whenever refreshing the development, integration or staging environment databases from the production database as part of a release cycle, doing a simple Features revert reenables the correct environment-specific modules and sets the right environment-specific variables.

As the Environment Modules project states, $conf[‘environment_modules’] should not be set on your production site in its settings.php, however the module itself can still remain enabled on production without a performance hit — it just doesn’t do anything in that particular environment.

Apr 18 2013
Apr 18

It's the year 2013 and here at Cocomore we are looking forward to the future of Drupal and the release of Drupal 8.

With the release of Drupal 8 the official support for Drupal 6 ends. At the latest from this event the use of Drupal 7 should be planned. There is still some time left, but a migration does not happen during overnight. And no one wants to run a system that is not supported any more and where no security updates are available. Even http://drupal.org will soon be migrated

On February 13th 2008 Drupal 6 was published. One year later in August 2009 Cocomore started to publish its own Drupal Core because there were several problems with the official Drupal 6 core. In all these years we started to love Drupal 6 - we had 5 really good years together.

Since Drupal 7 was published we started to use it for our new projects. Recently we neglected our Drupal 6 core because we do not have many Drupal 6 sites left. So we think now it's time to say "Bye, Bye Drupal 6". We had a good time with you, but now it's time to move forward. Drupal 8 is coming. We will stop supporting Drupal 6 and we will not publish any new updates for our Drupal 6 core.

Everybody who does not want to resign the Drupal 6 core we recommend to have a look at the repository of Markus Kalkbrenner (Bio.logis) - https://github.com/mkalkbrenner/6. This Drupal 6 Core is based on the Cocomore core and contains the same modifications. So, a change without problems is possible.

We want to thank everybody who helped to work at the Drupal 6 core and even on the huge amount of modules. You have done a very great job. Thank you all!

Apr 08 2013
Apr 08
xml3d rubick

The XML3D Module provides a simple and easy way to integrate the XML3D models and applications into Drupal. The current 7.x-1.x version allows to simply enter the XML3D code into a Long Text field that has the XML3D Input Field formatter. The content will then be displayed on the page in the form of an iframe having the same size as the XML3D application.

We added this module to the blog and added a field with a XML3D example, see it at the end of this Article in action.

Requirements

The module has the following requirements:

  • Drupal 7
  • the field, field_ui, libraries modules
  • a browser with Web GL support (currently, Firefox and Chrome)
    • if you have a Intel GPU Chip and are using Chromium/Chrome on a Linux based OS, try to enable "Override software rendering list Mac, Windows, Linux, Chrome OS" under chrome://flags
  • the js library files (xml3d.js and camera.js) must be located in the corresponding folder in the libraries directory (the current version of the module uses XML3D version 4.3):
    xml3d library files structure

Adding the Field Type

After having installed and enabled the XML3D module, you must create a field of the Long Text type by going to Structure -> Content types -> Manage Fields:

xml3d add field

Then you must assign the XML3D Input Field formatter to the field by going to Structure -> Content types -> Display Fields and select it from the Format drop-down list.':

xml3d manage display

In order to add/modify your XML3D content you just need to go to your content type that contains a field with the XML3D formatter and paste the content into the field (you can grab the code from one of the examples available: http://xml3d.github.com/xml3d-examples/):

xml3d add content

The content is supposed to have one tag containing the rest of the content.

After performing all the step correctly, you should be able to see your XML3D content visualized:

xml3d rubick

As mentioned above, the XML3D element will be presented as an iframe that will have the size of the content inside (the width and height parameters of the element will be used for this). By default, the iframe has neither borders nor scrolling. That can easily be changed via the CSS file in the module ([modules folder]/xml3d/css/xml3d.css). The iframe has a class named "xml3d_frame" that you can use for styling it.

Global Integration into Drupal

While working on the module we met some obstacles. The major obstacle was the requirement to use the MIME-type application/xhtml+xml for the pages that have XML3D content. Moreover, the page must start with:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">

The problem is that a standard page in Drupal is not of application/xhtml+xml type and it has the following header (doctype) element:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
  "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" version="XHTML+RDFa 1.0" dir="<?php print $language->dir; ?>"<?php print $rdf_namespaces; ?>>

The header is hard coded in the html template file (modules/system/html.tpl.php) and is not/or hardly editable from within a module (it could be overridden by a theme, though). Thus, the first attempt to set the MIME type with php and change the header in the template file manually failed (it worked in Chrome only).

The second attempt to build in an iframe and put the content using JavaScript on the fly failed as well. It worked neither in Chrome nor in Firefox. Different techniques have been used here: starting from contentDocument.open('') (or contentWindow.document) with different MIME types including 'application/xhtml+xml' and finishing with '...src="http://drupal.cocomore.com/blog/xml3d-and-drupal/data:application/xhtml+xml...."'.

At the end, an iframe referring to a separate page (generating the content for a certain field) was decided to be used. The page must receive four arguments: entity type, entity id, field name and delta. For example: http://example.com/xml3d/iframe/node/18/field_testxml3d/0

To Do

The current version of the module is aimed to present a simple integration of the XML3D technology into Drupal. Thus, the content to be inserted is not supposed to be very long.

As an alternative option to the currently implemented variant could be uploading a file (or files) with the content to be inserted or selecting from a predefined list of content residing on the same or a third-party server. It would make the integration process of large pieces of code easier for the end user.

Example:

Mar 03 2013
Mar 03
Modules of the month story banner illustration.

Well, February is always a short month, but this year it seemed like it passed in just a couple of weeks… and now it’s already March and I’m only finally getting around to putting the final touches on this posting for the January “Modules of the Month”. How did that happen? Well, I won’t try to bore you or make excuses. It’s just been one of those months. I’m going to try to keep up my current momentum and evaluate and write up my favorites from February now… hopefully finishing that in the next week or so. If it’s not done by the 15th, it won’t be done till April since I’ll be taking off for my first trip to India in the middle of this month.

But I’m not here to write about myself. This is about some modules which I found might be worthy of notice… specifically those released in January 2013. It’s interesting to see the evolution of a Drupal version and what kinds of modules are being released these days. Almost no modules are being released for Drupal 6 and Drupal 8’s developer API is still far enough from maturity that there are very few modules being released for it, so almost all the focus is on Drupal 7. Almost anything really critical has already been done, so most modules now fit into areas of workflow improvement, integration of third-party libraries, developer tools, and addressing the needs of an increasingly mobile audience (responsive design). There are a lot of new modules for image display, for keeping a closer eye on site administration issues, creating better e-shops, deploying content from one site to another, and managing caching, among other trends. It’s clear that Drupal 7 is a mature product serving the needs of an extremely diverse community and it’s exciting to see all the new ways that, each month, developers encounter new needs and find inventive ways to further extend on the feature-set. So read on to see what new and fun stuff we got in January… (and I promise to try to get February’s review done in the next week or so).

*/ Access denied backtrace

The Access denied backtrace module helps track down the point where access rights are denied.How many times have you had to try to sort out access issues on a Drupal site? Sometimes this can be a pain, but the module, by Eduardo Garcia of Anexus IT, promises to help put an end to this senseless suffering; it helps track down the exact point at which a particular role is denied access for a particular node or path. Perhaps the screenshot here is a bit contrived; the only reason the basic "authenticated user" cannot create a new node of type "Article" is that they don’t have the appropriate permission checked. In a more complex site with lots of custom content and custom user-access code, this could be very useful. (My primary work is on a team where the access model for all content types and users would require a full article to explain.)

Status: There is a stable release available for Drupal 7.

Advanced help dialog

The module, by Dan Polant of Commerce Guys, allows developers to extend the popular Advanced Help module. By implementing the provided hook, you can add a link to the "Help" region of specific paths; the link opens a modal box with the relevant "advanced help" content. Nice.

Status: There is a development release available for Drupal 7.

Anonymous Redirect

The module, from Michael Strelan of Glo Digital, redirects anonymous users to another domain, but visitors can still reach /user or /user/login to authenticate. After logging in, users have normal access. This can easily be configured to limit access to a staging server and redirect users to your production site, the most typical use case for the module.

Status: There is a development release available for Drupal 7.

Boost Custom Expire Rules

The module, authored by Zyxware Technologies, allows setting different expiry times for content cached with Boost. Complex rules can be configured to fine-tune how long various content on your site is cached. Older nodes can have a longer cache lifetime, for instance. Rules can be configured for the URL path, node type, age, etc. This definitely looks like a must-have for sites which use Boost, especially if they actively add new content on a regular basis and retain older content.

Status: There are stable releases available for both Drupal 6 and Drupal 7.

Block Up Down

The Block Up/Down module allows you to easily disable or move blocks within a region without going into block administration.The module, coded by Pol Dell'Aiera of Trasys, is dead simple. Just activate it and you get three new contextual links on blocks so you don’t need to go into the block administration page just to disable a block or move it up or down within a region. I think this is great, since probably most of the time I go into the block administration page, which can take a while to load on a complex site with a lot of blocks and regions, moving one block up or down (or disabling a block) is all I really want to do, so allowing administrators to manage this from within the front-end is a really sweet feature.

Status: There is a stable release available for Drupal 7.

CKEditor Link File

The CKEditor Link File module, created by Devin Carlson, integrates (and requires) the CKEditor Link and File entity modules so that editors on your site can easily add links to existing files on your site. This definitely looks useful for sites which use CKEditor.

Status: There is a stable release available for Drupal 7.

Combined Termref

The module, written by Girish Nair, allows you to address up to three different vocabularies with one term-reference field; obviously only one vocabulary in the group can take “free tagging”. If new terms are added, they go into the first of the vocabularies selected for the Combined Termref field. There can be good reasons that you need different vocabularies, but the purpose can stay behind the scenes; content creation can be simpler by allowing entry with a single field. I think this looks cool.

Status: There is a beta release available for Drupal 7.

Commerce Cart Message

The Drupal Commerce Cart Message module displays a message in the cart.The module, authored by Aidan Lister, provides an option to add rules for displaying messages on your Drupal Commerce cart. This definitely looks useful.

Status: There is a stable release available for Drupal 7.

Views Contextual Range Filter

The module, written by Rik de Boer of flink, provides a Views plugin that allows you to filter views based on a range of values for any field where this might make sense. For instance, you might want to filter by price range, age range, etc. This kind of search is a pretty common use case, so I suspect this will become quite popular.

Status: There is a stable release available for Drupal 7.

Creative commons field

The module, by Ben Scott, defines a field type for attaching Creative Commons licence types, so you can add CC licences to files or any entity type. There are other modules which can add a CC license, but they only work with nodes; files are likely a most common use case. Cool!

Status: There is a stable release available for Drupal 7.

Entity Extras

Categories: Utility

The module, coded by Dave Hall, provides extra utility functions to extend the Entity API module. The idea is to share useful functions here and improve on them before proposing them for inclusion in Entity API or Drupal core. If you aren’t a developer, you’ll probably only enable this if another module requires it, but if you write your own modules which use the Entity API, this is probably worth taking a look at.

Status: There is an alpha release available for Drupal 7.

Facebook Album Fetcher

The module, written by Kaushal Kishore of OSSCube, allows you to import your Facebook albums and photo galleries. You can also import the images from your friends’ accounts, too, but be sure you ask your friends if it’s okay. Personally, I only allow friends to view my Facebook account, so people like me might be annoyed if the images they shared on Facebook were pulled into a public-facing album without their consent. That said, companies with a Facebook presence might like to pull the images from their Facebook galleries into a gallery on their main website, and I’m sure there are many other good use cases for this module.

Status: There is a stable release available for Drupal 7.

Field Collection Deploy

The module, created by Robert Castelo of Code Positive, provides a way to deploy content from the Field Collection fields from one site to another. It extends (and requires) Features, Field Collection (of course), UUID, Node Export, and Entity API. Getting this to work is clearly non-trivial, but if you need this functionality, you’ll be happy to find this module.

Status: There is a beta release available for Drupal 7.

File Entity Preview

Categories: Media

The module, contributed by Graham Bates of Catch Digital, provides a widget for file fields with previews of uploaded files, as configured with File Entity. It otherwise works like the “core” File widget.

Status: There is a stable release available for Drupal 7.

Graphviz

The module, written by Clemens Tolboom, renders a Graphviz text file for further processing; it hooks into Graph API to provide Views integration and can output an image file using the Graphviz Filter.

Status: There is a development release available for Drupal 7.

Graph Phyz

Graph Phyz helps display a nice relationships graph. is another graph-related module contributed by Clemens Tolboom. It renders an interactive graph using Graph API. Pretty cool, if your site calls for this, and I can think of at least one project where this might have saved some custom coding.

Status: There is a development release available for Drupal 7.

Hide PHP Fatal Error

The module, by B-Prod of MaPS System, redirects users to a configurable error page whenever a fatal error is thrown in PHP. Of course the error is also logged into the watchdog so you can work on eliminating the error for the next user. Nice.

Status: There is a stable release available for Drupal 7.

Hierarchical taxonomy

The module, by Marcus Deglos of Techito, is a developer module (you won’t need this, as a non-coder unless another module requires it) which provides a simple hierarchical_taxonomy_get_tree() function which renders an array of a vocabulary’s hierarchical structure. This should probably be in “core”.

Status: There is a development release available for Drupal 7.

Image Zoomer

The Image Zoomer module integrates various Javascript libraries for getting a closer look at an photo.The module, contributed by Tuan, integrates two image zoom-related JQuery plugins; Power Zoomer and Featured Zoomer and the developer of this module is adding support for other modules which provide image zooming. This could be cool for online “catalog” images or for commercial photography sites who want to provide a closer look at an image without making it too simple for users to download a higher-resolution version.

Status: There is a stable release available for Drupal 7.

Image Focus Crop

The module, contributed by Nguyễn Hải Nam of Open Web Solutions, helps find the focal center of an image you are scaling and cropping and includes advanced facial recognition algorithms. This looks interesting.

Status: There is a stable release available for Drupal 7.

Image formatter link to image style

image_formatter_link_to_image_style.pngThe module, developed by Manuel García, provides an additional formatter for the core image field so that you can create, for instance, a “thumbnail” which links to a larger, watermarked version of the image. This seems like a common enough need that this kind of functionality should probably be added to core. Until then, there’s this.

Status: There is a stable release available for Drupal 7.

jQuery UI Slider Field

The Jquery Ui Slider Field module provides a simple way “slide” between a range of integer values.The module, developed by Sina Salek integrates the jQuery UI Slider plugin so you can easily allow users of your site to utilize a graphical slider to quickly enter an integer value in a field. This looks handy, especially for users accessing your site without a normal keyboard.

Status: There is an alpha release available for Drupal 7.

Juicebox HTML5 Responsive Image Galleries

The Juicebox integration module for Drupal helps you display a beautiful responsive image gallery.The module, written by Ryan Jacobs integrates the beautiful Juicebox HTML5 responsive gallery library into your Drupal site. There’s a lot to this module; probably enough to have a whole article dedicated to ways you can use it, but it definitely looks nice if you want to provide image galleries that render well on a wide range of devices. Like many other such modules that integrate third-party code, it requires Libraries and adding the Juicebox code to your sites/all/libraries directory. We should note that there are both Lite (free) and Pro (commercial) versions of Juicebox (you’ll need to decide which is more appropriate for your use case) and the maintainers of this module are not affiliated with the developers of Juicebox, itself. This module will work to integrate either version of Juicebox.

Status: There is a beta release available for Drupal 7.

Lazy Entity

The module, written by James I. Armes of AllPlayers.com, allows field values for Drupal entities to be lazy-loaded rather than loaded at the time the entity loads, so can provide a boost to performance and memory usage. This module is for developers, so will not be useful to you unless you are a coder who needs to lazy-load fields. Otherwise you would only enable this module if another module requires it.

Status: There is a development release available for Drupal 7.

Linked Data Tools

The module, by Chris Skene of PreviousNext, is a developer module to help retrieve, cache, and work with linked data sources. It depends on EasyRDF and X Autoload and Guzzle is also recommended.

Status: There is an alpha release available for Drupal 7.

Library attach

The module, written by Dave Reid of Palantir.net, adds a Library reference field type so that libraries can be attached to individual entities when rendered, thus saving your site from loading lots of unnecessary Javascript for every page. It also adds an option to the Views UI so allows adding libraries for specific Views displays. This is a great idea!

Status: There is an RC release available for Drupal 7.

Lorempixel

The module, written by Fredric Bergström of Wunderkraut, provides “dummy images” which it fetches from the very slick lorempixel.com web service. Oh, and the module can also be used to get the placeholder images added to content by Devel generate.

Status: There is a development release available for Drupal 7.

MD WordCloud

The MD Wordcloud displays a cloud of all terms in a vocabulary, sized according to frequency of their use.The module, written by Neo Khuat, creates a block with a “cloud” of terms from a taxonomy. You’ll need to download and add some Javascript files to the module’s “js” folder. So you don’t need to save and replace the Javascript files, it might be better to symlink them to a directory in sites/all/libraries.

Status: There is a stable release available for Drupal 7.

Multisite wizard

The module, written by Alex Posidelov, helps simplify the process of converting a single site Drupal installation to multisite. A lot of the work is done for you with just one click of a button and it helps lead the administrator through the rest of the requirements. It depends on the Backup and Migrate module.

Status: There is a stable release available for Drupal 7.

Notify 404

, by teknic of Appnovation Technologies, provides a means to send notification emails to a site administrator when a configurable volume or frequency of 404 (page not found) errors have occurred.

Status: There is a stable release available for Drupal 7.

Photobox

The Photobox module integrates the jQuery-powered Photo-box gallery as a display format for images.The module, developed by Andrew Berezovsky of Axel Springer Russia, adds an Image field formatter for viewing images in a Photobox image gallery. You’ll need to use the jQuery Update module since Photobox requires jQuery 1.8. This does look nice.

Status: There is a development release available for Drupal 7.

RecommenderGhost

The Recommenderghost module integrates the free external recommender service to help show users other content of interest on your site.The module, coded by hhhc, integrates the free recommender services hosted by RecommenderGhost. It makes it easy to display recommendations for “other visitors bought…”, etc. This is much simpler than installing and integrating a separate server.

Status: There is a stable release available for Drupal 7.

Reference helper

Categories: Fields

The module, created by Kevin Miller of Cal State Monterey Bay, is a helper module for displaying recent or most relevant entities under an entity reference field and was a winner of the Module Off challenge. It definitely sounds useful.

Status: There is a development release available for Drupal 7.

Regcheck

The module, produced by Tobias Haugen of Wunderkraut, adds a hidden checkbox to your site’s registration form; if checked, the registration process is aborted. “Robot” users tend to check the box, so it can be a simple way to eliminate at least some of the unwanted registrations used for spamming your site or other nefarious purposes. There are other modules which help with protecting forms like this, but a wide variety of spam prevention methods are useful for keeping a step ahead of the bot coders.

Status: There are stable releases available for both Drupal 6 and Drupal 7.

Simple hierarchical select

The module, written by Stefan Borchert of undpaul, defines a new form widget for hierarchical taxonomy fields so you can simply navigate the structure of the taxonomy and select a term.

Status: There is a stable release available for Drupal 7.

Site Disclaimer

The module, by Ilya I, can add “Terms of Use”, “Privacy policy” or other agreements to the registration form. Visitors who want to register on your site need to agree to the terms of the “disclaimer” in order to register.

Status: There is a stable stable release available for Drupal 7.

Tablesorter

The Tablesorter module integrates a jQuery plugin to allow standard tables to be sorted by any column.The module, coded by Shoaib Rehman Mirza of Xululabs, integrates the tablesorter jQuery plugin so that any standard HTML table with THEAD and TBODY tags can be turned into a sortable table without even requiring a page refresh. Of course it’s not helpful if the data is paginated, but for normal tables with all the data on one page, this could be useful. Of course you need to download the Javascript libraries and install them in your sites/all/libraries directory, and of course that means this depends on Libraries API.

Status: There is a stable release available for Drupal 7.

Taxonomy Protect

The Taxonomy Protect helps prevent users with some administration rights from deleting vocabularies.The module, contributed by Jay Beaton allows administrators to select certain taxonomy vocabularies and prevent them from being deleted. That way, even if some users who need to be able to administer taxonomies don’t fully understand the system, they won’t make the mistake of deleting a critical vocabulary.

Status: There is a stable release available for Drupal 7.

Topbar Messages

The module, created by Mark Koester of Int3c.com: International Cross-Cultural Consulting, allows you to add a message in the top of your Drupal pages. The message can be dismissed with a click on a “close” link and can include links and other formatting. There are other such modules, but this one might be the best fit for your use case. It does look useful.

Status: There is a development release available for Drupal 7.

Views Ajax Fade

The module, authored by Thomas Lattimore of Classic Graphics, is a Views plugin which allows you to add a fade in/out effect for Ajax-enabled Views displays. This would be nice for some use cases.

Status: There is a stable release available for Drupal 7.

Webform Countdown

Categories: Content

The module, by Andrew Lindsay provides a textarea component for Drupal webforms which includes a configurable, Twitter-style dynamic word or character count to limit the length of submissions. Of course it requires the Webformmodule and Libraries module (as well as the word-and-character-counter.js in sites/all/libraries.

Status: There is a beta release available for Drupal 7.

Webform Postal Code

Categories: Content

The module, is another Webform-enhancing module contributed by Andrew Lindsay. It adds strong, configurable postal code validation which can even be set to handle multiple countries simultaneously. In addition to the obvious dependency on Webform, this also requires the Postal Code Validation module.

Status: There is a beta release available for Drupal 7.

Jan 02 2013
Jan 02
Modules of the month story banner illustration.

Closing out the year 2012 with a bang, December brought us quite a number of new modules which look promising enough to cover; a few that I’m covering this time are far from ready or even only at the “concept” stage and normally would not be included, but they seemed particularly interesting or unique, and I want to see how they develop. Anyway, this month there were quite a few modules released for mobile support/responsive content. There were also several search-related modules, anti-spam modules, a couple of novelty modules, some interesting commerce-related releases, a number of Features package modules customized for various special-purpose distributions, lots of new “Third-party Integration” modules, theme enhancements, and more… I only wish I had more time so I could actually try out more of them, but there are several I do plan to get back to.

As usual, this post is sorted alphabetically and only covers modules which had their first release, or at least a new project created, in December. Selection for the Modules of the Month is a completely arbitrary process, but normally excludes common or niche items like a new payment method for Commerce that provides connections for a payment system used in, e.g. Romania. We also don’t normally include commercial service integration modules (unless the service looks really cool and is reasonably priced).

Anyway, it seems like only last week that I was putting the final touches on the November “Modules of the Month” story… oh wait, it was only last week: nine days ago, as I write this. Well I promised to try to get December’s published in early January, so I pushed some days around to make this happen. Let’s take a look at the modules, then, shall we? …

*/ Activation Code

The module, brought to us by prolific über-contributor Bryan Ollendyke of Penn State University, provides a fieldable “activation_code” entity type with a number of fields for an ID, creation timestamp, redemption timestamp, username, etc. It’s used by the Course Information System distribution as another method for authorizing access to online course materials, etc, but for those who don’t need the module on their site, it could still provide a useful example for how to build a fieldable entity.

Status: There is a development release available for Drupal 7.

Apachesolr Link

Categories: Search

The module, produced by Michael Prasuhn of Shomeya, enables indexing a Link field’s “target”, along with the entity it is attached to, in the Apache Solr search index. It might be obvious, but this module depends on Link and Apache Solr Search Integration; the Apache Solr Attachments module will also be useful if some of the links you wish to index are to PDF files or other “non-plain-text” results which you wish to index.

Status: There is a development release available for Drupal 7.

Are You A Human PlayThru Are You a Human Playthru login

The module, written by Chris Keller of Commercial Progression, provides a more simple, fun, and intuitive means for a user to prove they are human than typical CAPTCHA options. It uses game mechanics which a user interacts with rather than having users try to interpret text in graphics. CAPTCHA fields can be frustratingly and tedious, so it’s nice to see people are working on interesting alternatives. Cool! I often skip over commercial third-party integration modules, but this seems interesting enough not to pass up, and they do provide free options which might be adequate for many sites.

Status: There is a beta release available for Drupal 7.

Backstretch Formatter

The module, written by Yannick Leyendecker of LOOM GmbH, provides a field formatter for jQuery Backstretch - A simple jQuery plugin that allows you to add a dynamically-resized, slideshow-capable background image to any page or element. Once you have everything (JavaScript libraries and the module, etc) correctly installed, if you select “Backstretch” as field formatter for an image field which allows more than one image you will get a slideshow. If your slideshow needs don’t require anything too fancy, this could be the ideal module to implement it. Cool!

Status: There is a development release available for Drupal 7.

Badbot

Because we wouldn’t want one CAPTCHA alternative to be lonely… the module, developed by Yuriy Babenko of Suite101, provides another method of CAPTCHA-free spam-prevention; it is currently limited to the user registration form, but comment forms are in the works. Visitors must have JavaScript enabled in their browsers for this system to work; it displays an error if JavaScript is disabled. Since spam bots generally do not parse JS, this helps avoid the need for CAPTCHAs, which are often solved by low-paid workers these days, anyway.

Status: There is a stable release available for Drupal 7.

BetterTip

The module, produced by Shoaib Rehman Mirza of Xululabs, is a lightweight jQuery plugin for clean, HTML5-valid tooltips which can provide a richer user experience than default tooltip text.

Status: There is a stable release available for Drupal 7 (and the project page includes a pledge to provide a Drupal 6 version).

Breakpoint Panels

The module, developed by Daniel Linn of Metal Toad Media, adds a Panel style called “Breakpoint Panel”. When selected, it will display checkboxes next to all of the breakpoints specified in that module’s UI. Unchecking any of these will “hide” it from that breakpoint. If you are lost by this description of the functionality, it probably helps to understand that “breakpoints” define different display-width ranges so that you can determine layout for content on different width devices or even eliminate some content from being displayed on, e.g. devices less than 480 pixels wide. Of course it depends on the Breakpoints module, whose functionality is going into Drupal 8 “core”, and Panels, but you’ll also need to download some Javascript files and enable them with Libraries. See the project page for further details, but this could definitely help improve mobile/responsive content and the roadmap looks good, too.

Status: There is a stable release available for Drupal 7.

Christmas Lights

The module, created by Andrew Podlubnyj, is, depending on your use case, of course, probably just a novelty module, but one that might be fun to enable in the right season. It adds decorative “Christmas lights” for you and your users to enjoy.

Status: There is a stable release available for Drupal 7.

CKEditor for WYSIWYG Module

When Nathan Haug of Lullabot-fame releases a new module, it’s always GoodStuff™, so it’s no surprise that there are already hundreds of sites using the after just one month. It provides a WYSIWYG editor (surprise, surprise!) using the CKEditor library (surprise, again!). This project aims to combine some of the best of the Wysiwyg-module integration with CKEditor with the best of the standalone CKEditor-integration module, with support for the Drupal Image and Drupal Image captioning plugins, compatibility with other WYSIWYG editors integrated through the Wysiwyg module, and no inline styles inserted into HTML… among other nice features either already implemented or in the “roadmap”. It requires the Wysiwyg module and is incompatible with the normal CKEditor integration module (which must be completely removed before using this module).

Status: There is a development release available for Drupal 7.

Coins wallet

The module, authored by ssm2017 Binder, is a Bitcoin wallet system to be used with a devcoin-compatible daemon. This module is a complete rewrite for Drupal 7 of the never-released original Drupal 6 version discussed here and uses the bitcoin-php library. While I confess that I’m a bit leery of how this all works, I’m also fascinated by the idea of alternative currencies which aren’t controlled and manipulated by bankers and other “white collar criminals”, so while the optimist in me is curious to see how this works, the pessimist in me worries that between human greed and governmental attempts to rein this in, well… interesting work, in any case.

Status: There is a stable release available for Drupal 7.

Collapsible fieldset memory

The module, written by David Herminghaus, solves a nice little UX issue for Drupal. If you have ever worked on a project where you had to enter content into Drupal forms with fieldsets which needed to be uncollapsed to access required fields, or where closing fieldsets to get them out of your way is part of your workflow, you might like this module. It allows everyone, even anonymous users, to have stored defaults for any Drupal form with collapsible fieldsets, so if a fieldset on a form was uncollapsed when you last used it, it will start out that way the next time you do. Nice! Of course it requires Javascript (as do collapsible fieldsets). The developer is open to feature requests and issues, so pitch in if you use this module and help make it better. There’s a bit you should know about before implementing it on your site, so be sure to peruse the project page.

Status: There are alpha releases available for both Drupal 6 and Drupal 7.

Commerce Check

Status: There is an alpha release available for Drupal 7.

Commerce Message

The module, produced by Bojan Živanović of Commerce Guys, provides Commerce-specific Message integration, including some default message settings for common order states, such as “order paid”, “product added to cart”, “order confirmation”, etc. It looks like a pretty well-thought-out module to help provide automated or custom messages to clients at appropriate stages in their order process. It’s integrated with Commerce Backoffice and Commerce Kickstart v2, so is already in use on quite a number of sites.

Status: There is a beta release available for Drupal 7.

Commons Polls

The module, by Ezra Barnett Gildesgame of Acquia, and the primary maintainer of Drupal Commons, integrates Drupal’s “core” Poll module as a group-enabled content type in Drupal Commons 3.0.

Status: There is a development release available for Drupal 7.

Content callback If you register a content callback via hook_content_callback_info() it will be available in the Content callback field options.

—Project description excerpt

The module, developed by Jasper Knops of Nascom, allows you to return any renderable array, created in code, via a field; it also contains a sub-module which provides a searchable Views display, as well as a context condition, among other features you should check out on the project page. If it’s not clear, though, I might mention this is not a simple add-and-enable module; it provides some tools for coders and advanced site builders.

Status: There is a stable release available for Drupal 7.

Context Breakpoint

The module, developed by Christoph, helps bridge Context and Breakpoints so that you can alter a page based on the visitor’s screen resolution, browser window size, or aspect ratio. Installing it adds a context condition for “Breakpoint”. This could definitely be useful, especially if your site already uses Context. Of course it’s a bit complex, so please see the project page and the module’s README file for information about how to install, configure, and make use of this.

Status: There is an alpha release available for Drupal 7.

Context code

The is another module by Jasper Knops of Nascom. It provides “a new context condition plugin which allows you to trigger contexts from code”. It should probably go without saying that it requires the Context module and is a module developed for other developers. See the project page for implementation examples, but I think this looks very useful, at least for advanced Drupalists and coders.

Status: There is a stable release available for Drupal 7.

CP2P2: Content Profile to Profile2

The module, written by Damien McKenna of Mediacurrent, is an add-on for Profile2 to convert Content Profile content types into Profile types. Note that there is no admin user interface for this; all functionality is provided by Drush commands run in the terminal, so this module is targeted toward experienced Drupalists and coders.

Status: There is a beta release available for Drupal 7.

Create and continue

The module, written by Dominique De Cooman of Ausy/DataFlow, simply adds a button to node forms which saves the current node and opens node/add/CONTENT_TYPE to create another instance of the same node type and help streamline the content creation process.

Status: There is a stable release available for Drupal 7.

Crossdomain

Categories: Media

The module, written by Adam Moore of Stanford Graduate School of Business, simply creates a crossdomain.xml file at the root of your Drupal site and provides configuration setting for which domains should be included. This is useful for certain web services which may require different domains to have access to your site content.

Status: There is a stable release available for Drupal 7.

Currency for Drupal Commerce

The module, produced by Bart Feenstra replaces the native currency-based price display in Drupal Commerce with locale-based display, using the Currency module. Because proper display depends on locale (language and country) and not on currencies, this module helps ensure that users see prices in a format they are used to.

Status: There is a beta release available for Drupal 7.

Field Quick Required

The module, written by Jelle Sebreghts of attiks, provides a simple overview of which field are required for a given content type, without having to enter the settings for that field. You can also change the “required” setting for any field. Nice! It does this by adding an extra column to the “manage fields” overview for your content types, e.g. for /admin/structure/types/manage/article/fields, where you would normally have columns for “Label”, “Machine name”, “Field type”, “Widget”, and “Operations”, you would also have a column labeled “Required” with a checkbox that can easily be changed if you decide a certain field should (or should not) be required for a particular content type. This could be especially useful during the initial phases of designing a site’s content types and logic.

Status: There is a stable release available for Drupal 7.

"File Metadata Table" Field Formatter

Categories: Fields

The module, written by Jeremy Thorson, with support from Derek Wright, looks interesting. It’s still in development, but it provides a customizable “File Metadata Table” field formatter for file fields. All of the options are a bit much to list here, but given the profiles of these two super-contributors, I think this will be an interesting module to check back on. I’m expecting something awesome here!

Status: There is a development release available for Drupal 7.

Foresight Images

The module, developed by Graham Bates of Catch Digital, provides a field formatter which integrates the foresight.js library to display image fields. Images are requested and generated at the exact size required. As with other such third-party Javascript library integrations, this will require Libraries and you install the additional JavaScript code in sites/all/libraries. I’m not convinced that this module offers enough benefits to select it rather than one of the other more-established responsive image modules; I’m also not convinced otherwise and the Foresight Images project page includes a list of other “similar” responsive images modules and some brief notes about how the approach or features differ from those provided by Foresight Images. So this project page could be worth looking at if you need an overview to help choose the appropriate module(s) or approach for your next project.

Status: There is a stable release available for Drupal 7.

Forum notifications

The module, created by David Snopek, extends the Notifications module to add some nice UI improvements for notifications involving forums based on the “core” Forums module. If you have a site with forums and wish to have a nice user experience for “subscribing” (and “unsubscribing”) to forums or individual threads, this module could help.

Status: There is a development release available for Drupal 7 and a beta release available for Drupal 6.

htaccess

The module, coded by giorgio79, autogenerates a Drupal root htaccess file based on your settings, including such configuration settings as automatic insertion of Boost htaccess settings, whether or not to use “www”, Followsymlinks or SymlinksIfOwnersMatch, etc. You simply configure these settings at /admin/config/system/htaccess if this module is enabled and of course you could only enable this module when upgrading Drupal, to replace the default .htaccess with one based on your settings. I don’t think it should be so dangerous to try this, but you might want to make your own backup copy of your current .htaccess file, just in case anything goes wrong (in theory, this module should also make a backup copy of your existing .htaccess file).

Status: There is a stable release available for Drupal 7.

Image optimize effect

The module, yet another contributed by Peter Droogmans of Attiks, adds two new image effects to optimize image files to reduce your average page size. Most websites do not have very well optimized images and images can be substantially reduced in size, even without noticeable change in quality. This module uses pngquant to optimize png files and imgmin, which can work on various formats, but is best for JPEG files. Of course it depends on the relevant libraries (see the project description). For more information, see this recent article on the Performance Calendar blog: Giving Your Images an Extra Squeeze

Status: There is a stable release available for Drupal 7.

Image Style Pregenerate

The module, developed by Gabor Szanto, helps you to generate all the images for a new image style before enabling the style; it’s designed for bulk image generation on production sites where the performance hit of switching the image style in your field formatter without already having the new images in place, could result in issues. It relies on Views Bulk Operations (VBO) and File Entity.

Status: There is a development release available for Drupal 7.

Insert image with text

Categories: Content

The module, developed by Esben von Buchwald of Reload!, extends the Insert module to modify the image markup to include caption text below the image. I don’t know how this compares to other methods of adding an image caption, but if you are already using Insert, and you want a simple way to include image captions, this module could be useful.

Status: There are dev releases available for both Drupal 6 and Drupal 7.

Joyride

The module, written by Mark Koester of Int3c.com: International Cross-Cultural Consulting, integrates the Joyride plugin to provide a simple way to give a tour of features or information on your Drupal-based site. This looks pretty cool. Of course you need to download the Javascript and install it in your sites/all/libraries directory… and of course that means it also requires the Libraries module.

Status: There is a development release available for Drupal 7.

jQuery Tabs Field

The module, contributed by Varun Mishra, allows you to create up to seven tab fields, each with a “body” and “tab title” on any node where this field is part of the content type. On viewing the node, the module will format the output to display each as horizontal tabs, which can make for more attractive output. This is relatively simple compared to options where you could have a number of fields in each tab, but if it fills the requirements of your use case, this simplicity would be ideal. There are already quite a few sites using this and it should become much more useful when the “body” of each tab supports HTML formats (currently it only accepts plain text, but the first issue for this module has elicited a promise to get HTML support in there.)

Status: There is a stable release available for Drupal 7.

Kazoo API

The module, contributed by Bevan Rudge of Drupal.geek.nz, integrates the Kazoo REST API telecommunications platform into Drupal-based sites. This is fairly complex and the use cases for this are somewhat limited, so I’m not going to bother going into great detail, but it’s interesting to know about, nonetheless.

Status: There is a development release available for Drupal 7.

Kim Jong-filter The Kim Jong filter is used to highlight specified words or phrases within content

The module, coded by the prolific Peter Lieverdink of Creative Contingencies, provides an input filter that wraps all occurrences of names of great leaders in a <span> element with a suitable class for easy highlighting. Of course you could use it for other purposes, so this might be more than an odd novelty module.

Status: There is a development release available for Drupal 7.

Language fallback

The module, written by Peter Droogmans, a very active contributor who has done a lot for multilingual functionality in Drupal, allows you to specify a fallback language for each language on your site, so if a string is found untranslated in the preferred language, you can get the next closest language translation file. Example use cases are for regional variants of a language, so if there is no translation in “nl-be” (Belgian Dutch), it would default to a translation found in Netherlands Dutch “nl-nl” and finally default to a standard translation found in “nl”, if available. This could certainly be useful and I believe this is a backport of functionality that’s already been built into Drupal 8 “core” (if not, I suspect it will be ported to Drupal 8 as a contrib module).

Status: There is a stable release available for Drupal 7.

Layouter - WYSIWYG layout templates The Layouter module helps create templates within content to facilitate columns or other layouts.

The module, from Alexander of ADCI, LLC, provides a simple way to select a particular “layout” (e.g. columns) for content. It already integrates with the CKEditor and the developer plans support for other popular editors, but it can apparently be used without a WYSIWYG editor, too.

Status: There is a stable release available for Drupal 7.

Lazyloader filter

The module, authored by Derek Webb of CollectiveColors, provides an input filter for lazy loading images as they may appear in textareas and relies on the Lazyloader project for the actual lazy-loading of images. This module only provides a filter that renders <img> tags in a manner consistent with the needs of the Lazyloader module, while allowing you to theme the image output to your liking and preserve original image attributes. This looks useful.

Status: There is a stable release available for Drupal 7.

Leaflet MapBox

The module, contributed by Jaime Herencia of WebPartners, provides integration between another Drupal contrib module, Leaflet (which integrates the Leaflet JavaScript mapping library), and MapBox. The Leaflet module’s project page actually links to an example which uses Mapbox: The Intertwine, which documents trails in the Portland-Vancouver metropolitan region. This site really looks cool, so if mapping functionality is important for your site, this might be useful for you.
Caveat: Mapbox is not a free service, but is reasonably priced and includes some pretty cool tools and features, not to mention distributed map hosting.

Status: There is a stable release available for Drupal 7.

Link CSS

The module, created by Graham Bates of Catch Digital, allows you to add CSS files using the <link> element instead of @import. This is useful for live refresh workflows such as CodeKit which do not support files loaded with @import.

Status: There is a stable release available for Drupal 7.

Local Foodhub Local Foodhub defines the commerce functionality to support a foodhub in a community, where producers and consumers attend a regular collection day where ordered products can be collected. Foodhubs are a convenient way to provide local produce for people in the community while giving producers more regular orders.

—Project description

The module, developed by Paul Mackay, is a project description which definitely looks interesting, although there is, as of this time, no code released. Normally I don’t include modules in this column if there aren’t at least some Git code commits, but there is enough information already, and I like the idea well enough that I’m making an exception here. We need to have more local food production and distribution… and infrastructure to support this if we want to live in a future with more environmentally sustainable practices, so on behalf of my future children and grandchildren, I give thanks for people working on projects like this.

Status: Check back. Currently no project code.

Mobile Switch (Varnish version)

The module, developed by Paul Maddern of ITV, provides a simple automatic theme switch functionality for mobile devices, utilising Varnish for detecting the user-agent and providing proper cacheable pages using the same URLs per mobile device group. This helps avoid bootstrapping Drupal while still presenting the appropriate, cached content for each device type. Nice! Of course getting this all right is not simple, so be sure to peruse the project page for more complete implementation details.

Status: There is a stable release available for Drupal 7.

Moodle Connector

The module, produced by Pere Orga, aims to provide a common interface for modules that integrate Drupal with the open-source Moodle e-learning system. It does not provide any end-user features and the initial release simple adds an admin configuration page for you to enter Moodle credentials, but there are plans for some other appropriate features. If you have a site that bridges Drupal and Moodle, this could be a worthwhile module for you.

Status: There is a stable release available for Drupal 7.

Multilingual Panels

The module, created by Valeriy Sokolov, provides support for making Panels panes translatable, which could definitely be useful for multilingual sites which make use of Panels.

Status: There is a development release available for Drupal 7.

Organic Groups formatters

The module, produced by Eric Mulder of LimoenGroen, extends Organic Groups by adding additional field formatters for the “Groups Audience” field. The “Group delimited list” formatter allows you to display Group names (labels) as a delimited list. Other formatters may be added if requested in the issue queue.

Status: There is a stable release available for Drupal 7.

Panels Image Link

The module, authored by Nick Piacentine of the Mars Space Flight Facility at Arizona State University, provides a simple Panels content type to display an uploaded image and link it to a provided url/path. There are already quite a few sites using this, considering its very recent release, so I suppose this could become quite popular for sites using Panels.

Status: There is a stable release available for Drupal 7.

Pants

The module, produced by Angie Byron of Acquia, is an actual module instead of just code used in a tutorial demonstration, but the purpose is the same. The previous version of the Pants “module” (not actually released) was for Drupal 5. This project updates it to Drupal 7 code and may be used as part of Angie’s DrupalCon Sydney core conversation presentation about “Upgrading your modules”, which will cover getting Drupal 7 code ready to run in Drupal 8.

Status: There is a development release available for Drupal 7.

PDF Forms API

The module, authored by Kevin Kaland of WizOne Solutions, is an API module which you should only install if another module requires it or if you are a developer and want to use its functions, which are initially focused on PDF form functionality.

Status: There is a development release available for Drupal 7.

Pinterest Verify Website

The module, written by Peter Lieverdink of Creative Contingencies, simplifies the verication process for pinterest by adding a verification tag or page to a Drupal site.

Status: There is a development release available for Drupal 7.

Polychotomous Keys

The module, written by Ed Baker of the Natural History Museum, “allows you to build polychotomous keys using Views”. At least that is the “project description”, but currently there is not even a single code commit. While that would normally mean I’d skip the project for inclusion here, I’m interested in modules being developed for academics and there could be a lot of use cases for such a module. I’m looking forward to seeing it in action.

Status: Check back. Currently no project code available.

Prelaunch

The module, written by Dominique De Cooman of Ausy/DataFlow, allows you to set one page of a Drupal site as “prelaunch page”. An example use case might be to display a webform to collect emails to notify interested parties when your site is launched, or page with information about what’s coming. Your site can essentially be “offline” without using maintenance mode; it prevents users from accessing any part of the site besides the prelaunch page (although assigned roles can access other areas). This definitely sounds useful.

Status: There is a stable release available for Drupal 7.

Pushtape Admin

is actually a Drupal distribution for musicians, which was initially released about 18 months ago. So why am I including it here? Well, I’m not really, but there are five new Features package modules which were released in December which are all geared toward improving support for building sites with Pushtape and which might be useful even if you aren’t using the distribution. All of the following modules were contributed by Farsheed of Zirafa Works:

  • contains admin views and menus.
  • adds a simple file field to the Track content type to allow uploading mp3 files.
  • configures an event content type, view, and menu link.
  • creates a news content type, view, and menu link.
  • creates a simple photo-set to share a group of photos. Content type, views, and menu link are bundled; this also uses Colorbox.

Status: For each of these modules, there are development releases available for Drupal 7.

Radix Layouts

The module, produced by Arshad Chummun, provides responsive panels layouts set to work with Panopoly and the Radix theme (also contributed by Arshad Chummun). If you are using Panopoly, you might like Radix and if you are using Radix, you might like this module, especially if you need responsive layouts for mobile devices.

Status: There is a development release available for Drupal 7.

Restaurant

is a new distribution, also developed by Arshad Chummun, which is based on Panopoly and designed to simplify hosting websites for restaurants. Several supporting modules were also released in December:

  • provides base configuration and structure.
  • adds a blog system.
  • provides structure for creating and managing events.
  • provides structure for creating and managing menus.
  • provides structure for creating and managing slideshows.
  • adds theming helpers.

Status: There are development releases available for Drupal 7 for the Restaurant distribution and each of the listed supporting modules.

Search API Stanbol

The module, written by Stéphane Corlosquet and Wolfgang Ziegler provides Drupal integration with Apache Stanbol, a new and exciting search technology for extracting information from “unstructured” text content. Getting into the full details of how this works is well outside the scope of this column, but this definitely does look interesting. This module requires the Search API and RDF Extensions modules.

Status: There is an alpha release available for Drupal 7.

Single Image Formatter

Categories: Fields

The module, created by Federico Jaramillo of SeeD, exposes a formatter that displays one image from a multi-value image field. It allows the same options as the original image formatter, but adds an option to choose which image to display. For some use cases, the Field multiple limit may be more suitable, but the Single Image Formatter might be more efficient for situations where there are many values in a multi-value image field.

Status: There is a stable release available for Drupal 7.

Sky field

The module, created by Leonid Mamaev and Alexander of ADCI, LLC, is sort of a new, improved version of the Node field module released a few months back by the same developers. It allows you to add unique custom fields to any single Drupal entity (node, user, comment, etc). You can add text fields, long text fields, links, radios, select, checkbox, taxonomy terms, among others and includes an API to add support for additional field types. This could be very useful for sites where an occasional instance might benefit from an extra field that isn’t normally used for that content type.

Status: There is a beta release available for Drupal 7.

Twitter Web Intents

Categories: Views

The module, developed by Francisco José Cruz Romanos of Hiberus, integrates Twitter’s Web Intents system to add extra Twitter links for replying, retweeting, adding to favorites, following, etc, into a view of Twitter messages. This allows users to interact with Twitter content from within the context of your site, without needing to leave the page or authorize an app just for this interaction.

Status: There is a stable release available for Drupal 7.

Twysi

The module, created by Tony Star of Acronis, is “an amazing Twitter Bootstrap WYSIWYG HTML5 editor”, at least that’s what the project description says. But it might be a bit early to tell about the module, itself. Currently, if I install the wysihtml5 library, I can select it as the editor for a given text format, but no buttons are present and no editor shows up on a text area. That said, this does sound like a project worth checking back on.

Status: There is a development release available for Drupal 7.

URL token URL token is an API module that provides token-based authentication for other modules, where the token can be used in URLs without requiring a Drupal user. Tokens can also be limited to a set number of uses or a fixed period of time.

—from the project’s README.txt

The module, by Marcus Deglos of Techito, is “an API module to make token-based access control simple”. Normal users should only install this module if another module requires it. Developers might want to take a look at the project page for some decent code examples of how to request a token and check that a token is valid. Note: in case this is not obvious, this module has nothing to do with the Token module. “Token”, in this context, is simply an access key.

Status: There is a development release available for Drupal 7.

Views OG cache

The module, from long-time contributor Amitai Burstein of Gizra, adds a Views time-based cache, configurable per group; uses OG-context to identify a group’s view to cache; includes OG-access integration: if the group is private, caching is done per-user instead of per-group… among other listed features. This definitely looks like it could be useful for sites using both Organic Groups and Views.

Status: There is a development release available for Drupal 7.

Welcome

The Welcome module displays a custom message when users log in.The module, from Blair Wadman displays a simple, configurable welcome message when a user logs in. Simply enable it at admin/config/people/welcome, and yes Token support is included. The example message displayed at left uses Tokens for both the site-name and username. (Of course the “Swachula” username is courtesy of “Devel generate” and “d7test” is my local Drupal 7 testing environment.)

Status: There is a development release available for Drupal 7.

Yet Another Yellow Box This is mostly being used to announce weather-related school closings on sites where I've been using it.

—from the project description

The module, authored by Micah Webner of Access-Interactive, provides a simple way to add a prominent “announcement” block of filtered text to any pre-configured region. The contents and visibility of the announcement block can then be managed by users who may not otherwise have permission to manage blocks. If you have a site where staff may need to make emergency announcements, this could be a useful module to set up. See the project page for further information about how to get everything working.

Status: There is a development release available for Drupal 7 and a stable release available for Drupal 6.

Zoundation Support

The module, written by Jeff Graham of FunnyMonkey, is designed to work with the responsive HTML5-based zoundation theme and its sub-themes. It provides custom menu builder functions and blocks for menus, a foundation navbar and topbar, a custom field formatter for orbit slideshow integration, improved placeholder integration for elements, and “other minor UI improvements” that work better in this module than in the zoundation theme, itself.

Status: There is a development release available for Drupal 7.

Dec 23 2012
Dec 23
Modules of the month story banner illustration.

November 2012 was a busy month for a lot of people involved in Drupal contribution. It was the final weeks before the “feature freeze” for Drupal 8, so a lot of the focus was on new features for the next great release of Drupal. Many of the “new projects” were simply “namespace reservations” for new core modules or planned contrib modules which relate to Drupal 8; most of which had no project code committed at all (for some, presumably, it’s all in the main Drupal 8 repository). But there were also a number of new feature-enhancing modules released for Drupal 7 (and a few for Drupal 6), several which improve search functionality, a few for delivering mobile-friendly content from a Drupal site, some for commerce, others designed to help manage Drupal sites and ensure that nothing slips through the cracks when moving from “development” to “production”, among other new gems.

It’s fun, too, that we got a couple new “novelty” modules in November: one, Driesday, puts a “Happy Driesday!” message on your site every November 19th; another is a bit more insidious, with a fully-disclosed dependency on Bad judgement: Feature creep allows you to nostalgically hang onto the “good old days” when Features had a few more quirks. So if you want to remember that fun, just turn this module on and, as the module description says, “every time that you export or update a feature the Feature creep module will randomly add an extra component to your feature, what fun!”

Before we get into the module descriptions, of course, I should acknowledge the very late arrival of this month’s release of this column. It’s been one of those months… again. But let me try to hold onto my optimism that I’ll be seeing you with December’s write-up in just a couple weeks. I’ll be aiming for the first week of January. Now let’s have a look at the “new” modules.

*/ Apache Solr Term Proximity

The module, coded by the prolific Chris Pliakas of Acquia fame, should be of interest for sites using Apache Solr. It boosts the relevancy of documents in which the search terms appear closer together. In other words, if I’m searching for “data migration”, a document which has these two words together should rank higher than another document where they are separated by a few words, which should rank higher than one where these words appear in different paragraphs. Nice!

Status: There is an RC release available for Drupal 7.

bigint

Categories: Fields

It’s always nice when developers share modules which help to get around some of the native limits in Drupal. One such limit is the lack of a proper “BigInt” integer type, which might not be needed for most sites, but is certainly a limitation that developers have to work around for some use cases. The module, by Ryan Coulombe of NewMedia!, provides a true BigInt field, thus saving site builders from having to find creative ways to handle text or decimal values that they really want to be an integer. Cool!

Status: There is a stable release available for Drupal 7.

Block Group

Categories: Utility

An example “block group” to display the “user blocks”The module, by znerol, provides a taste of Drupal 8-like layouts by extending the Drupal block system with “block groups” which can be placed like a normal block, are nestable, and can have regions within them. A simple use case might be that you want all of your user-related blocks to be kept together in one “user blocks” block group, which you can then put into whatever theme region you wish, without having to always fix their order when adding them to a different theme or reorder them if you change the region. Very handy!

Status: There is an alpha release available for Drupal 7.

Book Touch

The module, which requires the Thumbnav module, is another innovation from Bryan Ollendyke of Penn State University, who has been contributing loads of great modules in recent months. It provides gestures and touch events for mobile navigation of an online book to help replicate the experience of a touch-sensitive e-book reader. Most awesome!

Status: There is a beta release available for Drupal 7.

Bounce reasons

The module, produced by Alexander of ADCI, LLC, may or may not be a good idea. It pops up a Webform in an overlay, when your site visitors attempt to close a window, where you can ask why they are leaving. Personally, I think I would just find this annoying and might likely avoid following future links to the site, but that’s just my initial reaction; maybe I’m not the typical web user and it’s possible that in some cultures people wouldn’t mind a site preventing a window from being closed to ask them why. That said, maybe it would be better to provide an “opt-in” for such an “exit poll” feature, i.e. ask visitors when they arrive to your site if they wouldn’t mind being asked about their experience when they leave. But perhaps you have a client who has asked you to build exactly this functionality? If so, rather than argue with them about why this might not be a good idea, you now know “there is a module for that”. And maybe using this for a while would help them improve their site. The project description page doesn’t specifically mention it, but it would seem to depend on Webform… and possibly also Bad judgement. Hmmm…

Status: There are stable releases available for both Drupal 6 and Drupal 7.

ckeditor_syntaxhighlighter

The module, by Jason Xie of VicTheme, integrates syntaxhighlighter into the CKEditor module by loading another yet another JavaScript project, ckeditor-syntaxhighlight. It depends on the CKEditor and SyntaxHighlighter modules, as well as the JavaScript libraries they require, installed in sites/all/libraries per installation directions (and the Libraries module, of course).

Status: There is a stable release available for Drupal 7.

Commerce Backoffice

The module, by Bojan Živanović of Commerce Guys, provides administration enhancements for Drupal Commerce and is already in use on over 2,000 sites less than a month after its release (perhaps largely since it’s a component of the latest release of the Commerce Kickstart distribution). It includes three sub-modules, each of which have a number of dependencies and the project page does a good job of explaining everything, so I won’t say more than this: if you are using Commerce and aren’t using the Kickstart distribution, you will probably benefit from adding and configuring this module.

Status: There is a stable release available for Drupal 7.

Commerce Price Extra

The module, from Marc ElBichon, adds extra features based on the price component in Drupal Commerce, including allowing ordering of price components in the cart pane, printing discounts on their own line, and other nifty features.

Status: There is a stable release available for Drupal 7.

Commerce Rules Extra

The module, also developed by Marc ElBichon, is a library of Rules events, conditions, and actions to support Drupal Commerce site building.

My wish is to merge all modules based on Rules and Drupal Commerce in a single one. It forks the apparently-unmaintained Commerce Extra Rules Conditions module. See the project page for more information about what this module already supports or to suggest additional features.

Status: There is an alpha release available for Drupal 7.

Commerce Search API

Categories: Search

The another module, contributed by Bojan Živanović of Commerce Guys, provides Commerce-specific Search API integration and fulfills a feature request that dates back to the early days of Commerce. It was covered on Commerce Module Tuesday and is part of the latest Commerce Kickstart, so is already used by many sites. If you don’t use Kickstart, and want improved search functions for your Commerce-based site, this is a good module to consider.

Status: There is an RC release available for Drupal 7.

Context Block Visibility

The module, coded by Peter Berryman, provides context for block visibility using the normal block admin page. This could be handy for certain use cases.

Status: There is an alpha release available for Drupal 7.

Dictionary Export

The module, coded by Ed Baker of the Natural History Museum, provides support for Microsoft Office-compatible dictionaries in (*.dic) format for any vocabulary on your site.

Status: There is a stable release available for Drupal 7.

Download Userpoints

The module, by Eugen, provides a way for you to allow access to private files via user points. This looks useful for communities which provide points for contribution and require points for downloads of community-contributed files (as one example use-case). It requires the Userpoints module.

Status: There is a beta release available for Drupal 7.

Drifter

The module, produced by Peter Anderson of PackWeb, allows fields to be floated to the left or right of content. While this kind of layout is normally provided by theme CSS, it can be useful for it to be theme-independent.

Status: There is a stable release available for Drupal 7.

EasyRdf

The module, from Chris Skene of PreviousNext, provides Libraries API compatibility for EasyRdf, which, in turn requires Libraries . It should only be installed if other modules require, but definitely looks useful.

Status: There is an alpha release available for Drupal 7.

Entity reference multiple display

The module, written by Jean Valverde of Linagora, provides a new field formatter for Entity Reference that let you configure different view modes for each referenced entity, for instance if you want the first elements to be displayed in full and subsequent elements to be displayed as teasers, this module could be your friend.

Status: There is a stable release available for Drupal 7.

Entity Reference Views Formatter

Categories: Fields

The module, authored by Maxim Podorov, provides a Views-based entity reference field formatter which allows you to use any view to show entity reference field value(s). It’s based on the Entity Reference View Field Formatter (sandbox) project from Katherine Bailey.

Status: There is a development release available for Drupal 7.

Facebook Autopost

The module, written by Mateu Aguiló Bosch of Human Bits, provides simple configuration to allow your site to automatically post to designated Facebook Pages. It includes a good developer API, integrates with Rules and the Entity API and includes Libraries integration for the Facebook Developer PHP SDK. It includes a Facebook app, which you authorize to make posts on the designated accounts’ behalf. There is a detailed video tutorial on the setup process linked on the project page.

Status: There is an alpha release available for Drupal 7.

Field Formatter CSS Class

The module, by Christian Zuckschwerdt, is perhaps a bit similar to the aforementioned Drifter module; it adds a CSS selector for fields so that you can select to, for example, use a class which floats an element left or right on a per-node basis. Of course you need to set up your theme for the classes and configure your fields, so it’s not a simple “add-and-activate” module, but it should give content authors a bit more control of display for individual nodes. The author invites the community to request additional features, so I think this will definitely be useful for a lot of sites (and there are already quite a few using it). Nice!

Status: There is a stable release available for Drupal 7.

Final Polish

Categories: Utility

The module, by Yannick Leyendecker of LOOM GmbH, helps take care of some of the last steps that are often forgotten when launching a Drupal site. It allows you to disable access to paths like /node, /rss.xml, etc; it uploads a “touch icon” to be used by mobile devices; it verifies the existence of /favicon.ico, /apple-touch-icon.png, etc, so that you don’t get a plethora of 404 errors in the logs, and the author invites input for additional features, but already has a nice development road-map to include checking recipients for Webform emails, checking the site email address, redirecting to the front page on errors (access denied / not found), etc. This can definitely streamline the last steps of getting our sites ready for use, so I’ll definitely be giving this a try.

Status: There is a development release available for Drupal 7.

Gumroad

The module, from Eric Peterson of Tableau Software, helps use Gumroad to sell products on a Drupal website. I normally skip over modules which integrate commercial services, but what Gumroad offers and what they charge for their services seems like a good deal. So if you want to, for instance, sell your self-produced music and don’t want to spend a lot of time (and/or money) building up e-commerce infrastructure, handling payments, and all that, this can be a simple way to collect a reasonable percentage of the incoming revenue, and start making sales, without a ton of work. Of course, if you have more involved needs for e-commerce functionality, you’ll probably want to use Drupal Commerce, but I think this module should be attractive for a lot of creatives who simply want to focus on the “fun stuff” and just sell a few things from their sites.

Status: There is a development release available for Drupal 7.

Hackpad

The module, contributed by Andrew Berry of Lullabot, integrates Hackpad into a Drupal site. Hackpad is a hosted service, based on Etherpad (but with a lot more cool, more modern features), which allows collaborative editing of documents; it’s very cool, fun, and can be used for a lot of purposes for teams, so I think the interest in Hackpad will definitely grow, as will the features supported by this module which is still new enough that the API for it has not yet been documented, but with Lullabot behind its development, you know it will be awesome!

Status: There is a development release available for Drupal 7.

Image Combination Effects (ICE)

The illustration image from the ICE project page with three pictures placed on an easel.The module, by Guy A. Paddock of Red Bottle Design, is too complex to succinctly summarize, but if you are building an image-centric site (e.g. a site to display your photography), this looks very useful for combining image effects or displaying multiple images at the same time (as one image), i.e., like “spriting” icons, but with larger images. It was designed to reduce the number of requests necessary for loading a slideshow, where they still wanted the client to be able to add new images or adjust the display order, but it looks like there could be a lot of potential use cases. It looks like this offers some pretty cool features that you might want to consider if image display is an important part of your planned site. I’ll certainly be playing with this.

Status: There is an alpha release available for Drupal 7.

jQuery Placeholder

An example of HTML5 placeholder text in a formThe module, written by James Silver of ComputerMinds, integrates the HTML5 Placeholder jQuery Plugin to provide backward compatibility, using a Javascript-only method, for older browsers which don’t support the HTML5 placeholder attribute. For those not so up on HTML5 attributes, the “placeholder” attribute provides the “placeholder text” you see in a form field before you click on it to, e.g. enter your name, but until HTML5-support improves, we need some fallbacks, so this looks like a useful module.) It requires jQuery 1.6+ and the Elements module.

Status: There is a beta release available for Drupal 7.

Legal Extras

Categories: Content

The module, contributed by Rafal W., adds additional features to the Legal module, including the option to allow a registered user to access your site with reduced permissions if they reject the “terms of use”, display the date each user accepted the terms of use, and a number of related features to help manage those annoying legal issues that might be a headache for you, too. I hope I won’t have to use this anytime soon, but it’s nice to know this module exists.

Status: There is a development release available for Drupal 6, but I suspect a Drupal 7 port will be in the works.

Mass Password Reset

The module, written by Mark Shropshire of Classic Graphics, allows a Drupal site administrator to reset the password on all user accounts (except user/1) and then notify all users. It’s good to know this module is available if there’s ever an emergency situation where we might need it.

Status: There is a stable release available for Drupal 7.

Meta tags: Panels

The module, contributed by Diogo Correia of DRI, extends the Meta tags module with support for Panels pages. It also has Features integration, so that if you export a panels page, the meta-tag configuration is exported with it. Cool!

Status: There is a beta release available for Drupal 7.

Mobile Switch Blocks

The module, written by Siegfried Neumann, extends Mobile Switch, a module contributed by the same author, to provide block visibility control for mobile devices. This sounds useful.

Status: There is an alpha release available for Drupal 7.

OG homepage

The module, produced by enzipher, allows you to configure an Organic group’s front-page as the default “home” for logged in members of the group; it also includes options to determine how a user is redirected if they belong to more than one group, among other nifty features. This could be useful for a lot of Organic Groups -based sites.

Status: There is a stable release available for Drupal 7.

Performance and Scalability Checklist

The module, contributed by Travis Carden, is similar to the popular SEO Checklist module, which he also helps maintain. It provides an interactive, step-by-step checklist to help manage the common tasks involved in launching or administering a Drupal site; in this case where it comes to optimizing your site’s software stack, from Apache to your Drupal theme.

The Performance and Scalability Checklist module interface for Drupal 7.

This module is still new and the topic it attempts to cover is so broad, that the module is sure to change and improve in time, but it already looks pretty darn useful. The author is actively seeking suggestions in the Performance and Scalability Checklist issue queue, so please give it a try, then add your 2¢ to help improve this module. Enabling this module requires the ChecklistAPI module.

Status: There is a beta release available for Drupal 7.

Performance data

The module, by Nathaniel Catchpole of Tag1 Consulting, is envisioned to be a UI for viewing and analyzing performance data that you’ve recorded and saved using other tools. When a key core maintainer starts a new project, there’s usually reason to take notice and expect there might be great things coming. That said, according to the project page, this is still in the early stages of development, so unless you have an interest in assisting the development process, you might want to wait a while to try it out.

Status: There is an alpha release available for Drupal 7.

Print Anything

The module, coded by Chris Desautels of R2integrated, helps you configure special rules for generating print-friendly output for any path. There is some work to getting it all working, but it has some nice features and helps you handle a lot of content that isn’t otherwise simple to print, as well as helps maintain your brand visibility by including your logo in the output, among other features.

Status: There is a stable release available for Drupal 7.

Quo.js

The module, created by Bryan Ollendyke of Penn State University, integrates the Quo.js mobile event library into Drupal. As with other such modules, you’ll still need to download and install the JavaScript code, separately. It provides a number of features, including environment detection, and event detection, such as reading “tap”, “hold”, “pinch”, “rotate” and other such mobile gesture events. It integrates well with, and enhances, the other modules recently released by the same prolific contributor, including the aforementioned Book Touch and Thumbnav modules, so it certainly looks useful and I expect it will grow in use as more sites start providing mobile-specific features.

Status: There is a beta release available for Drupal 7.

Search API Page Block

Categories: Search

The module, produced by Tobby Hagler of Phase2 Technology, uses the Search API Page module to perform a search using the currently viewed node’s title as keywords, displaying the results in a block, so you can direct users to related content.

Status: There is a beta release available for Drupal 7.

Simple Anti-Spam

Simple Anti-Spam user interface for Drupal 7.The module, by xandeadx, adds two new elements to designated forms: one checkbox, labeled “I’m not a spammer” and a hidden checkbox, “I’m a spammer”. If user does not check the first or (is a bot which) has checked the second checkbox, the form is not submitted and displays a warning message.

Status: There is a development release available for Drupal 7.

Simple Table of Contents

Categories: Content

The module, coded by Devin Carlson of Ontario’s Ministry of Northern Development and Mines, automatically adds a table of contents to all of your node content, as long as the content is within the node’s “body” field. It’s a simple add-and-enable module which presumably depends on normally-structured content (with headings, etc.)

Status: There is a stable release available for Drupal 7.

Speedboxes - Fast checkbox handling

The module, produced by Manuel Pistner of Bright Solutions GmbH, provides a Javascript-based method to easily check, uncheck, or invert the current setting of a selected range of checkboxes in a grid, e.g. the Drupal permissions page; simply click and drag over a selection of checkboxes and a toolbar appears which allows you to modify the state of all the selected checkboxes. Too cool!

As an alternative to the module, the Bright Solutions blog also includes post about how to use speedboxes as a browser plugin so you can benefit from this feature on any page you visit with your browser.

Status: There is a stable release available for Drupal 7.

Thumbnav

The module, yet another module produced by Bryan Ollendyke of Penn State University, provides a mobile-friendly framework for using a website on touch-driven devices, with support for a variety of navigation methods and an API for developers. It includes support for Quo.js, but doesn’t rely on Quo. See the project page for links to some nice demonstrations, but if you are looking for ways to improve your site’s mobile support, this could definitely be worth checking out.

Status: There is an alpha release available for Drupal 7.

Unit Conversion Formatters

The module, developed by Tony Rasmussen of Metal Toad Media, provides formatters for number fields to convert values between any unit supported by the Units API module. This could certainly be useful for some sites.

Status: There is a stable release available for Drupal 7.

Views Drupal 7 to Drupal 8 upgrade

Categories: Views

BACK UP YOUR DATABASE BEFORE ATTEMPTING TO USE THIS MODULE FOR AN UPGRADE. Really. We're not kidding.

—from the module’s project page description

The module, written by Jess of University of Wisconsin-Madison, a major force behind getting “Views in core” in Drupal 8, helps migrate Drupal 7 Views data to Drupal 8. It’s nice to see work on this is this far along.

Status: There is a development release available for Drupal 7 (really a Git repository you can check out).

Wunderstatus connector

The module, from Henri Hirvonen of Wunderkraut, sends information about installed modules as a JSON to a central service. This could be useful for monitoring a group of sites your company maintains, so I look forward to giving this a whirl and seeing how it develops.

Status: There are alpha releases available for both Drupal 6 and Drupal 7.

XSL Formatter

The module, developed by Dan Morrison of Sparks Interactive, provides a field formatter to process XML content through a defined XSL stylesheet for rendering. If that sounds useful, it’s probably best you just look at the well-written project page, because there is quite a lot of information there, which runs well outside the scope of this column.

Status: There are dev releases available for both Drupal 6 and Drupal 7.

Nov 23 2012
Nov 23
Modules of the month story banner illustration.

October 2012 brought us a nice batch of interesting new modules. Of course I wanted to tell you all about them weeks ago, but without going into excuses and details, I’m afraid getting this published didn’t go as planned. I’d like to get back on schedule to release the next installation of this series in early December, though. Anyway, it’s great to see all of the innovations that have been introduced in the past month. You can tell that Drupal 7 has truly reached maturity by the kind of modules that are being released now. Many, if not most, of the new modules integrate with and extend the functionality of other contributed modules—for example, there are three new modules which provide plugins for the Facet API—or integrate exciting new jQuery plugins to bring a bit of sizzle to your site.

As usual, the list is in alphabetical order and I haven’t tried all of these modules (although I have experimented with quite a few of them and even eliminated a few from consideration since they seemed a bit too “broken” at this point.) Some of these modules might not be ready for use yet, but just show good promise and look worth keeping an eye on. Creating this monthly list is as much for me as it is for you, but I do hope that the modules I select work well for you, if you give them a try, and I look forward to seeing your comments about any of these modules.

*/ Adminimal Administration Menu It adds a nice and simple minimalist look and provides some tweaks to improve your Drupal administration experience. The menu hierarchy is now simpler and easier to understand […] The shortcuts fit nicely and have a small icon that separates them from the normal admin menu links.

(Adminimal Administration Menu project description)

The module, by Andonis Ratsos, changes the style of the popular module’s menu bar.

The adminimal_admin_menu look and feel

Whether or not you like the way it restyles the Admin menu is likely a matter of personal taste, but I do observe that even with only the default shortcuts in the menu (no custom shortcuts added) the larger font of the menu makes it take up a lot space at the top of the window and it starts to wrap to a second line if the window is narrower than about 1,100 pixels, so it’s possible that people administering Drupal sites from smaller devices (netbooks or tablets, not to mention smartphones) might find this modification less appealing. On the other hand, the larger links should make easier targets for a finger-tip… six of one, half a dozen of another.

adminimal_menu shortcuts

Personally, I like the theme change and I like the Adminimal Adminimal Theme admin theme, too, so for my personal testing sites, I’ll go ahead and leave these active. I’m hoping to see some simple customization available in the future… I think I would want to see that before recommending it for client sites.

Status: There is a development release available for Drupal 7.

Autocache

The module, by Teemu Merikoski of Wunderkraut simplifies caching of Views and Panels and has some support for appropriate clearing of Varnish caches, too. It’s still new and the roadmap is perhaps a bit longer than the current features list, but I’m sure that this will be worth keeping an eye on.

Status: There is a development release available for Drupal 7.

Bootstrap optimizer

The module, by Maslouski Yauheni, has only been released for a couple of weeks and there are already over 150 sites using it, so it must be worth a try! On the other hand, if you don’t “improperly delete” modules, perhaps it’s not so useful for you. It appears that its primary functionality is to remove modules from the system table which no longer exist in the modules directory, so if all your sites are well-maintained, this might not do much for you. It looks like Drupal 8 should hopefully resolve this issue. But until this is really fixed in core, there is a place for modules like this, especially for older projects that might not be very actively maintained and might have had some modules deleted over the time. For such sites, this module claims to provide a several-fold increase in the bootstrap time, and provides screenshots as evidence.

Status: There is a beta release available for Drupal 7.

Bulk User Delete

The module, produced by Mark Theunissen of Four Kitchens, provides with a text area where you can enter a list of email addresses for users you wish to “bulk delete”. Normally, it’s probably easier to simply check the boxes next to the names of a group of users you wish to delete and select the action “Cancel the selected user accounts”. But I can imagine scenarios, especially scripted ones, where using this module might be a simpler solution, e.g. when creating a number of test users en masse, users with various combinations of roles and/or other custom relationships, and then removing them after the tests have been run. This could be useful if you want to run such tests on a busy production site without needing to take special care that you select only the right users for deletion or when you have so many test users that they wouldn’t all be visible on one page of users.

Status: There is a stable release available for Drupal 7.

Cache Lifetime Options

The module, from giorgio79, provides additional cache-time options which can be selected on admin/config/development/performance, with cache lifetimes up to a year. This is especially useful for sites with a lot of static content. Boost is a recommended companion.

Status: There is a stable release available for Drupal 7.

ceaZine

The module, written by Carlos Espino Angulo, allows you to display PDFs in a Colorbox overlay with “page flip” effects and everything. If you want a nice effect for showing off your books, this is a great module. Setting it up is a bit involved, though, so be sure to check the project page for full details. It requires a few of jQuery libraries, and (of course) a recent version of the Libraries module, Views (for an included display of all your online magazines, if you wish to use it), and PDF to ImageField which, in turn, requires ImageMagick, but it uses only CSS, JS, and HTML—no Flash. Nice!

Status: There is a stable release available for Drupal 7.

CkEditor Plugin: Google Doc embedded iframe

The module, authored by Sergio García Fernández, is an extension for the popular CKEditor module, which provides a simple editor button for easily embedding Google Docs iframes in your content.

Status: There is a stable release available for Drupal 7.

Cloze

The module, written by Sivaji Ganesh of KnackForge, provides Cloze question type for the Quiz module. Cloze questions are the type of question where blanks are inserted in the middle of questions, a question type commonly used in language assessments.

Status: There is an alpha release available for Drupal 6.

CodeMirror editor

The module, developed by Darren Mothersele, adds syntax highlighting directly to your Wysiwyg editor experience, using the Codemirror Javascript library, among other nice features. If you have a site where writing and displaying code is important, this could well be useful. It doesn’t even require WYSIWYG (although there are, perhaps, more fully developed alternatives if you simply want syntax highlighting for code entered in a basic text area), much less any particular editor. It’s still under active development, but the plans look interesting, so this is definitely worth keeping in mind for projects which involve presenting code.

Status: There is a development release available for Drupal 7.

Collapsible comment threads

The module, developed by Manuel Garcia, uses jQuery to collapse and expand comment threads, thus helping remove the “visual noise” of deeply threaded comment conversations. This could be especially useful for sites with a forum or very active discussion in blog comments.

Status: There is a beta release available for Drupal 7.

Content Access Admin

The module, by Peter Lieverdink of Creative Contingencies, lists all node grants in a simple table. This is especially handy since special access grants, provided by the Content Access module, are otherwise only visible on the individual nodes.

Content Access Admin displays a table with some filters to see just what you want to, with links on each node title to help you jump right to each node and manage the access.

Status: There is a development release available for Drupal 7.

Date Facets

The module, contributed by Chris Pliakas of Acquia, provides date range facets similar to major search engines so that you can look for search results within a defined date range. Too cool! It integrates with the range of search modules available for Drupal, including Apache Solr, among others. Of course it’s search technology, so implementing it is not as simple as activating the module.

Status: There is a beta release available for Drupal 7.

Dates

The module, created by Chris Charlton of XTND.US, is not actually part of the Date module, but provides a range of additional advanced date formats. This could be especially handy, but beware that disabling or uninstalling this module does not remove the packaged date types and formats which are stored in the Drupal database when the module is enabled.

Status: There is an alpha release available for Drupal 7.

Devel Input Filter

The module, contributed by Garrett Albright of PINGV, aids development of input filters; it provides a page where you can enter test input to see filtered input, without caching. It’s really only for developers who are debugging text filters.

Status: There is a development release available for Drupal 7.

Email Log

The module, authored by Mikael Kundert of Wunderkraut, allows site maintainers to get email notification when there are critical log entries. Log entry tokens would need to be supported for this to be done by Rules, but even so, it greatly simplifies staying on top of important site updates. The user interface and options are almost exactly the same as the Watchdog Digest module’s, except that this module will send you an alert whenever there is a watchdog entry of a given severity level, so you might wish to send only the most critical alerts with this module and use Watchdog Digest to send an email which includes all the other log entries in one email.

Status: There is an RC release available for Drupal 7.

Entity Translation Tabs

The module, contributed by Ryan Weal of Kafei Interactive, gives site editors an edit tab for each enabled language. For the time-being, it only supports nodes, but the roadmap includes support for other entity types, e.g. taxonomy and user entities, among others. This should be great for multilingual sites! It is currently in active development, so I won’t list the potential caveats. Please see the project page for recommended usage.

Status: There is a stable release available for Drupal 7.

Facet API Collapsible The search facet links from Facet API Collapsible

The module, by Peter Droogmans of Attiks, is a “full project” release of a sandbox project created by Acquia’s Katherine Bailey. If the name doesn’t make things especially clear, it probably helps to understand that the Facet API is another Drupal project, which this one extends (although the project description leaves that part out). Faceted search (e.g. searching within a range of pre-selected terms or dates) is what the Facet API does and this widget provides a slick interface for single-click searches.

Status: There is a stable release available for Drupal 7.

Facet API tabs

Categories: Search

When it rains facets, it pours facets. The module is another widget for the Facet API, written by Erno Kaikkonen of Exove Ltd in Finland. It allows you to display search facets in tabs and the project description indicates you’ll want to do “some CSS work to style the tabs”. If a sidebar isn’t what you need, this might be the ticket.

Status: There is a beta release available for Drupal 7.

Field collection feeds

The module, contributed by Howard Ge, provides feeds integration for field collections and also requires Feeds. This could well be useful.

Status: There is an alpha release available for Drupal 7.

Field Collection Tab formatter

Field Collection Tab Formatter imageThe module, written by Lee Rowlands of Australia’s PreviousNext gives us a nifty output for field collections in a tab-set. I can think of at least one place I’d personally like to use this and apparently I’m not the only one since there are already more than 50 sites using the module, barely a month after its release… a pretty solid start! Of course it requires the Field Collection module.

Status: There is a stable release available for Drupal 7.

Field formatter conditions

The module, written by Kristof De Jaeger of Wunderkraut, adds conditions to field formatters. The “Manage Display” tab for each entity type provides per-field configuration of field conditions. It supports fields from the Field API and Display Suite with a number of included conditions and it requires Field formatter settings

Status: There is an alpha release available for Drupal 7.

Flipcard - nodes made into flashcards

The module, by Hugh, helps you create node-based flashcards where the node title is the “answer”. Users can sort based on custom taxonomies and can record whether they knew the answer to each card, so questions they are still having trouble with will show up more often. I used to cut up index cards to make actual paper flashcards to study for exams and more recently, but still some years ago, made them to study on an old Palm device, with great success, so I know the usefulness of flashcarding, but this even offers jPlayer support to use automatically-played audio recordings for the questions. Very cool! You can see the demo site, where you can also learn a bit of Thai, to get an idea of the usefulness this module already offers. There are always new things I’m trying to memorize, so I’ll be a likely candidate to give this module a try. The only thing I’m really hoping it will offer (that I didn’t notice in the demo) is the ability to use the “question” as the “answer” (i.e. to practice both directions), but I doubt that would be too hard to manage. The demo site already offers the option to “view words” (clicking on each word in English takes you to the audio recording of its equivalent in Thai, whereas in practice mode, you hear the word and check to see if you know what it means). Personally, I think the current mode is better for the initial phase of passive comprehension, but for learning to actively speak a language, it’s better to work from “mother tongue” to “other tongue”. So ideally, the module should support working in both directions and keeping track of your answers in both directions, too, but maybe all this is already in the development roadmap.

Status: There is a development release available for Drupal 7.

Invites

The module, developed by Raz Konforti of Linnovate, allows you and/or your site members to invite new members to your site and includes an OG module to provide for inviting people to a particular group; it provides for the creation of a custom, fieldable Invites type and for custom invitation emails with Rules integration, among other interesting features. Google has proven the power of viral campaigns to build a community around a new product with “invitation-only” access… so this could definitely be a good idea for your community site, too. Note: Administrators of OG sites might, alternatively, wish to use the OG Invite People module, which eliminates the registration process for invitees.

Status: There is an alpha release available for Drupal 7.

jQuery selectBox Styles of SELECT element provided by the jQuery selectBox module.

The module, produced by Henry Umansky, provides multiple Javascript-enhanced styling options for SELECT elements. It integrates Cory LaViska's selectBoxjQuery library plugin, so like most such integration modules, it requires the Libraries module as well as the afore-mentioned and eponymous selectBox jQuery library installed in sites/all/libraries, according to the nicely detailed directions on the project page. The selectBox demo is really freakin' cool! There are various options for slick effects in addition to the various ways of building a SELECT box for improved UX.

Status: There is a beta release available for Drupal 7.

JS Watchdog

The module, coded by Bevan Rudge provides Drupal.watchdog() in Javascript to log errors to the database. It’s really mostly a developer tool for people working on Javascript code, but this should be useful. It provides a number of nice features, though, so if you are working on JS code, you might want to take a look at this. Unfortunately, there isn’t a Drupal 7 version (yet), but according to the project page, creating one should be “trivial”, so hopefully we’ll have a nice D7 version ready for use before long, too.

Status: There is a beta release available for Drupal 6.

Leaflet Widget for Geofield Simple geometries supported by the Leaflet Widget

The module, developed by Tom Nightingale of Affinity Bridge, a Geofield widget that provides a Leaflet map and uses the Leaflet widget plugin to work with geometries, making it possible to, for example, mark up web-based maps with the outline of a real estate propery or city district. Of course it requires Libraries and configuring any kind of mapping is never as simple as just activating a module, so be sure to check the project page for more details.

Status: There is a beta release available for Drupal 7.

Logo Block

The module, authored by Kristofer Tengström, provides flexibility in how you display your site logo, including applying an image style, and provides a block you can place anywhere, thus circumventing the limitations of the Drupal logo configuration.

Status: There is a stable release available for Drupal 7.

MC Hammer

The module, written by Nils destoop of Wunderkraut, provides tools and templates for sending sophisticated email newsletters from your Drupal site. There is only a development release, so far, but it already has an impressive feature-set, so if you plan want to produce a newsletter, this could be a great tool to look at, and with Wunderkraut behind this, we can bet this will develop nicely.

Status: There is a development release available for Drupal 7.

Nice Date This is the kind of date display provided by Nice Date

The module, written by Nicholas Thompson of Turner Broadcasting Systems, provides a nicely formatted date to display the publication date of nodes, e.g. blog posts, and comments. It uses a CSS Sprite with all the months, days and years to generate a 41x40px block with the date in it.

Status: There is a stable release available for Drupal 7.

Node Display Field

The module, contributed by Christian Biggins of PreviousNext, provides an alternative teaser display mode which can be enabled for any node, e.g. a “promo” mode. This could be useful.

Status: There is a development release available for Drupal 7.

No term pages

The module, written by Gaël Gosset of Insite, provides an extra option for a vocabulary which blocks the terms in that vocabulary from ever being displayed as a page. With all the different ways that terms are used in a typical Drupal site, not wanting term pages for some vocabularies is a pretty common use case, so now you know—there’s a module for that! This functionality should probably be in “core”.

Status: There is a stable release available for Drupal 7.

OG Invite People

The module, developed by Aleš Rebec, has some features in common with the previously-mentioned Invites module, but it’s only for Organic Groups. One interesting feature of this module is the complete elimination of the registration process. A user entity is during the invitation process and the invitees receive a one-time login link in their invitation emails.

Status: There is a development release available for Drupal 7.

Panels Content Cache

The module, developed by Graham Taylor of Capgemini, provides a content-aware cache plugin which supports caching Panels and other Ctools displays, until their content changes. Isn’t that how caching should work? Caching strategies and the technologies that support them are not trivial and there are a number of options, but this module looks promising for those who are working with Panels content.

Status: There are dev releases available for both Drupal 6 and Drupal 7.

Permissions Grid The simple permissions UI provided by the Permission grid module Links to the Permissions grid on the general permissions page.

The module, by Joachim Noreiko, provides a per-role grid of permissions for modules which declare structured permissions. These permissions can be viewed, on a separate page for each role, with the entity types in rows and permission verbs in columns. Of course it doesn’t eliminate the normal sea of permissions… but for the basics related to your site content, this helps simplify things. This is very nicely done and I’ll be sure to use it.

Status: There is a stable release available for Drupal 7.

Retina Images

The module, contributed by Michael Prasuhn, provides the option for core image styles to output a high resolution version of images for high DPI or retina displays. It can be used to return high resolution images for all devices. There can be very little difference in file-size between a low-resolution, high-quality image and a high-resolution, low-quality image. But the high-resolution image will work better on high-resolution devices and still look fine when scaled down for display on a normal-resolution monitor. This module already has a strong user-base, considering its recent release and the developer seems to be doing a great job managing the issues, so if improving mobile UX is important for your site, this module might well be worth considering.

Status: There is a beta release available for Drupal 7.

Rich Snippets

The module, developed by Chris Pliakas of Acquia, enhances the search results to provide nicer “snippets” of content returned in search results, much like those displayed by major search engines. Instead of just displaying the teaser or first characters of an article, it displays that with ellipses and the user’s search term within the context of the content. Very nice! Caveat: Be sure to read the “Usage” and “Gotchas” on the project page. Configuring a perfect site search is a non-trivial task, but this definitely looks helpful and works with core search and Apache Solr.

Status: There is a development release available for Drupal 7.

Role memory limit The simple configuration for the role_memory_limit module.

The module, developed by Kevin Yousef, is a small module which allows you to configure separate PHP memory limits, per role. For normal users, the memory limit could be set to 128MB, while the admin interface, which can require much more memory, can be allocated what it needs. Of course you need access to change the memory limit in your php.ini file. Since the memory limit is set per-user and this often has to be higher than normal for a Drupal site, just because of the greater needs for the site administrator, logical configuration with this module could, in theory, dramatically improve the number of concurrent users your site can handle. I’ll certainly be giving this a try.

Status: There is a stable release available for Drupal 7.

Scoville

The module, produced by Garrett Albright of PINGV, which gets its name from the “hotness” scale used for describing a variety of chili pepper’s level of spiciness, helps you easily display a block or page of your site’s “hottest” content. For more complicated use cases, you’ll probably want to use the Radioactivity module, instead, but since configuring it can be a bit of a chore, people who just want to get a basic “hot content” block into their site might want to give this one a try.

Status: There is a development release available for Drupal 7.

Search API Taxonomy

Categories: Search

The module, developed by Steven Jones of ComputerMinds, adds some extra features for integrating taxonomy into the Search API, including indexing the taxonomy term parents and display of a facet (using Facet API) for top-level terms. It’s still in development, so additional features could well be added, but this already looks very useful.

Status: There is a development release available for Drupal 7.

Taxonomy Freetag Detection

The module, by Leigh Morresi, extends Term reference fields of type Autocomplete term widget (free tagging) with an option to add a button to scan other fields (e.g. your node “body”) to and add words which it finds which match existing terms in that vocabulary. Of course you might need to eliminate any terms it adds, e.g. a word in your document might match an existing term, but have the wrong context for the meaning of the term (e.g. “Features” is a taxonomy term here on the Cocomore Drupal site, but if I simply talk about the features of a module, I’m not going to tag the article with that term). This looks pretty simple and very useful, especially if your site uses the standard autocomplete “tagging” widget, which is the only widget this module complements. See the project page for configuration tips.

Status: There is an alpha release available for Drupal 7.

Twitter Profile The Twitter Profile module in demo use.

The module, created by Rishikesh Bhatkar, provides a nice, very configurable, Twitter profile block which can show any or all of: your Twitter profile info, counts for Tweets, Favorites, Listed, Followers, and Following, and avatars for your Followers and Following, with a configurable size and number of avatars displayed. It also includes some theming presets for the block. This is much more configurable than many of the other Twitter blocks. What would be nice for community sites would be allowing each user to display their Twitter profile on their user profile page, but it looks like the block only supports one Twitter account.

Status: There is a stable release available for Drupal 7.

User Pic Kit

The module, written by Daniel Phin, allows your site’s users to choose a user image (avatar) to represent their account, from any of a number of providers, while still supporting a Drupal core image upload option. Each user can choose which provider they wish to use. The included third-party image host providers include Gravatar (which requires the Gravatar integration module) and Robohash, but with the add-on User Pic Kit Extras! module, you can add Twitter, Facebook, and other avatar hosts. You can also locally cache the remote pictures (such as Gravatar) and use Drupal image styles on the downloaded pictures! There is even a documented API which allows you to implement other image hosts. This looks like fun and can certainly improve the user experience for configuring a new user account profile for users who already have an established online persona.

Status: There is an alpha release available for Drupal 7.

User Search to People Administration

The module, developed by Benjamin Melançon of Agaric, removes the user search functionality from your site (for normal users) and moves it into /admin/people/search (a tab on the /admin/people). Most sites probably have no need for visitors to search user accounts, but administrators can still find such a search useful. By moving the user search tab into the “admin realm”, this also opens up the option of allowing people to view user profiles without also providing the “search users” functionality (since, by default in Drupal 7, if you want to block access to /user/search for a particular role, you need to leave the permission to “access user profiles” unchecked. So in addition to moving the user search functionality into a tab where it’s convenient for site administrators, it also breaks this unnecessary relationship between access to user profiles and to using the user search feature. This looks useful for many common use cases, perhaps even more ideal for most sites than the Drupal default.

Status: There is a stable release available for Drupal 7.

View mode per Role

The module, developed by Edouard Cunibil allows site administrators to set a view mode for content depending on the user role, with configuration in the content type edit form. This can be useful when you want your content to be displayed differently, to different user roles, but do note that this is not a content access module, so if you must prevent certain roles from being able to gain any kind of access to certain fields, you should consider the Field Permissions module.

Status: There is an alpha release available for Drupal 7.

Watchdog digest

Configuration for the Watchdog digest module.The module, created by Edgár Prunk-Éger, sends watchdog entries by email in a digested format, so you don’t get a separate email for each entry (of a type where you might want to send a message to a site administrator). This looks very useful, but the current project page is very lacking in detail and there is no link to the configuration, so it took looking at the code to figure out where to adjust settings for this. It adds a fieldset to the “Logging and errors” configuration page (/admin/config/development/logging), where you can configure the number of messages per e-mail, the e-mail address(es), and the severity level threshold, which can be set anywhere between “debug (all)” and “emergency”, although probably for anything that extreme you might want a Rules-triggered action to immediately email the site administrator.

Status: There is an alpha release available for Drupal 7.

WYSIWYG Configuration with TinyMCE and Shortcodes

The module, coded by Jurriaan Roelofs, is a Features-generated module which helps streamline a particular Wysiwyg configuration which is rather sophisticated. If it happens that you want all the features included here, it could be a nice way to get it all configured. But if you want something simpler or wish to use a different editor, etc, this is probably not for you. It includes Media integration and all kinds of things that a lot of sites won’t use, but which are notoriously tricky and time-consuming to work out, so if this kind of rich configuration is what you want, then all you need to do is download all the dependencies (see the project page, there are a ton!) and then simply enable this module to have it automatically enable and configure all its dependencies. This looks very useful if it happens to be exactly what you need; if not, it could be also be useful as a quick route to experimenting with a lot of modules and features that you might want to use.

Status: There is a beta release available for Drupal 7.

Oct 11 2012
Oct 11
Modules of the month story banner illustration.

Once again, I’ve surveyed the looong list of modules from the past month (September 2012). This article highlights and summarizes the features of some I found most notable. As usual, the selection and any opinions are my own and the order of appearance here is strictly alphabetical. Category terms are links to Drupal.org projects categorized with the terms. I’ve added terms for modules whose description lacked appropriate categories or might have been missing categories I thought were appropriate.

This month, while we didn’t get any new novelty modules which require bad judgment, there was one which I thought was funny and which otherwise serves no real purpose, other than perhaps to provide an example of object oriented PHP design with interfaces, etc: the module, written by Jess of University of Wisconsin-Madison and Drupal.org’s reigning IRC queen. Its very short (non)description is sure to make you smile:

Q: You’re a vegetarian; why do you get to have the blt project namespace?

A: The BLT is actually a base implementation; a properly architected interface does not mandate bacon.

Now let’s get on to the serious modules…

*/ Apache Solr Exclude Node

Categories: Search

The module, by Jens Beltofte of Propeople, helps to exclude individual nodes from Apache Solr, which can be useful when you have indexed a specific content type, and want to exclude a few nodes of that type. A checkbox, “Exclude from Apache Solr” is added to the node edit forms for selected content types. It requires Apache Solr Search.

Status: There are stable releases available for both Drupal 6 and Drupal 7.

Apache Solr Field Collection

Categories: Search

The module, created by David Rothstein of Advomatic, allows content stored within a Field Collection to be indexed by Apache Solr search as part of the entity that the field collection is attached to. Enabling the Facet API module allows fields attached to the field collection to be available to add as search facets.

Status: There is an alpha release available for Drupal 7.

Architecture

The module, by Sheldon Rampton of DrupalSquad, provides reports documenting how your Drupal site is architected. These reports include “Site Entities”, which lists all content types, taxonomies, and other Drupal entities that have been defined for your website with a list of all fields for each fieldable entity; “Site Taxonomies” lists all taxonomies and their associated terms; and “Site Variables” lists all variables and their values. The purpose of this module is to provide some easy-to-read documentation of how your site is put together.

It looks like there are a number of other interesting features in the development roadmap, but this already looks very useful for documenting the way a complex Drupal project is put together.

Status: There is a development release available for Drupal 7.

Attribution

The module, written by Marcus Deglos of Techito, adds configurable attribution text at the bottom of your site content’s body field, so that if it’s scraped, attribution will normally be included.

Status: There is a development release available for Drupal 7.

Better 404

The module, contributed by Yvan Marques, is based on an article from A List Apart. It aims to provide more useful information when a visitor reaches your 404 page.

Status: There is a stable release available for Drupal 6. This looks very promising, so I’m hopeful there will also be a Drupal 7 release and that perhaps functionality like this could be part of Drupal 8 “core”.

Commons Like

The module, by Ezra Barnett Gildesgame of Acquia, allows users to “like” content and comments using the Commons “Like” widget and the Rate module and VotingAPI and has a stated goal to be expanded to be useful on sites that are not on the Drupal Commons distribution.

Status: There is a development release available for Drupal 7.

Commons Radioactivity

The module, also contributed by Acquia’s Ezra Barnett Gildesgame provides integration with the Radioactivity module to help identify the most active content and includes Views displays to accelerate the site-building process.

Status: There is a development release available for Drupal 7.

Conditional Flags

The module, coded by Sebastian of Taller, provides additional API features for the Flag module, for custom conditions between flags, so that logically, if, when one flag is set, another flag should be unset, this can be done automatically. There are also plans to build a user interface for site builders.

Status: There is a beta release available for Drupal 7.

Content Tab

The module, coded by Ashish Thakur of Srijan Technologies, India, makes it easy for site administrators or other users with appropriate permissions to view the content written by a particular user; it provides a page with sub-tabs for each content type created by a given user and a tab on each user page which lists all content written by that user and eliminates the need to build up this kind of functionality with Views. It also provides a admin UI to configure various display options, among other features lacking in the core “Tracker” module.

Status: There is a stable release available for Drupal 7.

Context Get

The module, created by Peter Vanhee of Marzee Labs, provides a Context condition plugin for $_GET arguments. It allows you to activate contexts with arguments like local?context=home or local?context=pro and was created to fill a feature request for Context.

Status: There is a stable release available for Drupal 7.

Deploy Services Client

The module, by David Rothstein of Advomatic, provides a Services client which communicates with Deployment endpoints and helps perform other operations on the content which the Deployment module does not directly support such as deleting or unpublishing content on an endpoint. Note that this is an API for developers only; there is no user interface.

Status: There is a beta release available for Drupal 7.

Drush Permissions

Categories: Drush

The module, created by Klaas Van Waesberghe of dotProjects, enables Drupal site administrators to easily query user permissions from the command line. It can display reports of all permissions with module and role filters, identify if a user has a given permission, or list all roles a permission is assigned to. It is not actually a module (but I’ve included it here since, like Drush, it’s on Drupal.org as a module and looks pretty darn useful). It should not be installed as a module, but as a Drush plugin, i.e. use drush dl drush_permissions to install, but from outside a Drupal root directory.

Status: There is a development release available for Drupal 7.

eKaay - QR Code Login

The module, written by Daniel Wehner of erdfisch, allows users of a Drupal website to log into their accounts by scanning a QR code on the PC screen with a smartphone, thus streamlining the login process for users on devices where entering username and password tends to be less convenient.

Status: There is a development release available for Drupal 7.

Facetapi Multiselect

Categories: Search

The module, another contribution from David Rothstein, provides a multiselect widget plugin for the Facet API module which allows faceted searches to use a multiple select dropdown for drilling down into the search results. It’s primarily designed to help integrate faceted search with JavaScript plugins such as the jQuery UI MultiSelect Widget (where this module has primarily been tested), jQuery UI Multiselect, and Chosen.

Status: There is a beta release available for Drupal 7.

Field Orbit

The module, coded by Elliott Foster of Four Kitchens, provides an Orbit slideshow display mode for image fields and field collections with images and much of it is a Drupal 7 port of the Field Slideshow module.

Status: There is a stable release available for Drupal 7.

Field UI permissions

The module is yet another coded by David Rothstein. It provides independent permissions for managing fields attached to each type of entity so that you could, for example, give an “administrator” role permissions like “administer users” and “administer taxonomy” but reserve the rights to modify the underlying field structure for a “developer” role. This could certainly be handy for complex use cases.

Status: There is a beta release available for Drupal 7.

Godwin's Law

The module, by Tobby Hagler of Phase2 Technology, is helpful for managing online forums and allows you to automatically moderate threads and close the discussion when certain keywords are found. By default, the module is set to close comments when Godwin’s law is invoked, but other keywords can also be used as triggers.

Status: There is a stable release available for Drupal 7.

Hide Site

The module, developed by Barry Fisher of Real Life Design, provides a way to practically hide a particular version of a site from search engines even though it’s on a publicly-available development server without needing to patch your .htaccess or robots.txt files. Getting into the particulars of how it works is beyond the scope of this article, but it’s fairly simple to configure and should help keep a site out of the public eye until you are ready to officially release it.

Status: There is a beta release available for Drupal 7.

highlight js

The module, contributed by Juned Kazi of ICF International, integrates the highlight.js library to provide language-appropriate syntax highlighting for code examples on your site. It automatically detects the language, but you can also set the language for any block of code to ensure correct behavior. Of course it depends on the Libraries API highlight.js library, installed per the directions in this module’s README.txt file.

Status: There is a development release available for Drupal 7.

Image Field Cross Slide Slideshow

The module, created by David Whitchurch-Bennett of Drupology allows images uploaded into an image field to be displayed with the jQuery Cross Slide plugin as a display formatter for the image field within the “Manage Display” settings of your content type.

Status: There is a development release available for Drupal 7.

Image link to preset

The module, written by Gabor Szanto extends on the two core-provided options for setting link for an image field (i.e. “link to content” and “link to file”) to also allow you to link to any image preset for the image. It requires the Field formatter settings API module and definitely looks useful for many use cases involving sites with images.

Status: There is a development release available for Drupal 7.

Image or Video field formatter

The module, developed by Chris Cohen of Tigerfish Interactive, adds a field formatter for a media field that can either be an image or a video and allows for separate thumbnails depending on whether an image or a video is displayed, e.g. so that you can show a “play icon” over thumbnails for video. The shadowbox Javascript library is used to display the full image or video when the thumbnail is clicked. The media module is normally used in conjunction with this, but other configurations are possible. Setting this up is non-trivial and the full details from the module description and README file should be consulted.

Status: There is a stable release available for Drupal 7.

Live Feedback

The module, written by J. Renée Beach of Acquia, is similar to Google+’s feedback system; it leverages the html2canvas library to allow users to quickly report issues to site maintainers from within the context of the page where the issue occurred. By making it easier for users to report issues with all the detail needed for developers to replicate and resolve them, this module helps ensure that issues do get reported and resolved.

Status: There is a development release available for Drupal 7 and given that Acquia is behind this work, we can hope that Drupal 8 might actually include such functionality in core.

Masonry

Masonry is a dynamic grid layout plugin for jQuery. Think of it as the flip-side of CSS floats. Whereas floating arranges elements horizontally then vertically, Masonry arranges elements vertically, positioning each element in the next open spot in the grid. The result minimizes vertical gaps between elements of varying height, just like a mason fitting stones in a wall.

The module, written by Peter Anderson of PackWeb, makes the jQuery Masonry plugin available to Drupal as a library. It contains sub-modules for integrating with fields and Views; its field formatter allows you to display multi-value fields in a Masonry grid layout and integrates with existing formatters so existing formatter-specific options, e.g. Colorbox settings, are retained. It currently supports the field types: image, “long text” and “long text with summary”, and like most modules which integrate a Javascript library, it relies on the Libraries module. The Field formatter settings module is also required for the Masonry field formatter and of course Views is required for Masonry views. Add the Masonry javascript and configure according to the directions on the project page.

Status: There is a development release available for Drupal 7.

Memory profiler

The module, written by Tim Hilliard of Acquia, logs peak PHP memory usage to the Drupal watchdog and is light-weight enough it shouldn’t add to the memory errors you would be trying to resolve when you activate it. It can be used in a production environment, where enabling Devel would not be appropriate. Knowing this is available when we need it will make all Drupal developers sleep easier.

Status: There is a stable release available for Drupal 7.

Mobile Switch Block

The module, coded by Siegfried Neumann, extends the Mobile Switch module with a theme switch block with links to manually switch between your mobile or desktop theme and is compatible with Mobile jQuery. Of course it requires Mobile Switch (version 7.x-1.4+) and Respond.js is recommended. The block could be especially useful for people testing the site, but can also provide better options for users of mobile devices who might, for whatever reason, prefer to use your site’s desktop theme rather than the automatically-selected mobile theme.

Status: There is a beta release available for Drupal 7.

Mozilla Persona

The module, coded by Daniel Pepin of Digital Bungalow, adds Mozilla Persona functionality to your site so users with a Persona account can authenticate without need for a site-specific password; you can still require registration. It should nicely enhance the usability of most sites which require login. It depends on the Session API module.

Status: There is a beta release available for Drupal 7.

Panels Ajax Tabs

The module, developed by Patrick Hayes of HighWire Press / Stanford University, provides the ability to have a tabbed panel-pane that displays mini-panels within it and allows you to pass context from the “master” panel to the mini-panels via AJAX.

Status: There is a development release available for Drupal 7.

Password Field

Categories: Fields

The module, created by James Sinclair of OPC IT, provides for creating fields that store passwords, stored in encrypted format and (by default) will not display them on the website. This is useful, for example, if you are creating a website that integrates with other services and you would like users to be able to store their password more securely than using a text field, so could certainly be useful in unusual use cases. That said, the module description also bears a strong reminder not to use this module if you have any alternative.

Status: There is a beta release available for Drupal 7.

Passwordless This is still an experimental module, and using it on production sites is not recommended.

The module, written by Antonio Savorelli of Communikitchen, provides a replacement for the standard Drupal login form to allow logging in without using a password. Instead, every login is done via a “one-time login” link, as if the user had forgotten their password. This could be useful on sites where users are not expected to log in very often, but there are still a few things about the way this works that makes me nervous; e.g., currently you need to confirm a change of email address at the new address, but not at the old address, which would make it simple for someone who jumps on your computer, while you are logged in and your back is turned, to take over your (Drupal site) account. That said, as it’s still considered experimental and not for use on production sites, we can hope such issues are addressed by the time this module is released as “stable”. Once that’s true, I can certainly imagine using this for some sites.

Status: There is a development release available for Drupal 7.

PDF Archive

The module, authored by Brian Gilbert of Realityloop, allows you to generate PDF archives of any entity; generation is triggered by Rules actions and you can configure the entity view mode and role of the simulated user for each rule. It includes a Feature as an example for configuration and otherwise requires the Libraries API module, with TCPDF library installed, and the Rules module.

Status: There is an RC release available for Drupal 7.

Permissions per Webform

The module, written by Daniel Imhoff of UW-Platteville, lets you set standard (normally global) Webform permissions for each individual Webform, e.g. “Access webform results”, “Edit all webform submissions”, “Delete all webform submissions”, “Access own webform submissions ”, etc. It adds a “Permission settings” fieldset tab to each Webform node.

Status: There is a development release available for Drupal 7.

PixGather

The module, developed by Mike Kadin of Merlin Education, is a Drupal Module and PhoneGap application that allows users to easily upload photos to your Drupal site. It was developed so that guests at a wedding could share their pictures, but it’s suitable for a variety of use cases. Currently, the mobile app part of this is only for Android, but an iOS version is planned.

Status: There is an alpha release available for Drupal 7.

Plugin tools

The module, written by Chris Skene of PreviousNext, allows developers to browse the various plugins provided by different modules, information normally hidden in the code. The Drupal 7 versions supports Chaos Tools plugins, but it’s possible that a Drupal 8 version will work with “core” plugins. See the project page for more details, but this definitely looks useful for developers working with cTools.

Status: There is a beta release available for Drupal 7.

Render As

The module, by Stuart Clark of Realityloop, allows you to see page elements as they will be displayed to various users or roles without needing to switch users. Using it is not easy to succinctly summarize, so you should check the project page for directions, but this definitely looks like a useful project for developers and site builders.

Status: There is a beta release available for Drupal 7.

Resumable Download

The module, authored by Sina Salek adds support in Drupal for resuming incomplete downloads, which could be very useful for users on slower connections or for larger downloads and provides a number of useful configuration options.

Status: There are beta releases available for both Drupal 6 and Drupal 7.

Session Cache API If you are not a Drupal programmer, then you may stop reading now. Just enable this module if another module tells you to.

The module, written by Rik de Boer of flink, is a simple two-function API for programmers to cache and retrieve pieces of user/session -specific information, and works well even with anonymous users in a cached environment. It is not for caching large amounts of information or content, nor should it be used for anything sensitive, but definitely looks interesting as a replacement for the $_SESSION variable, which may not an option with Varnish or similar caching engines. Developers who find this short summary of interest should definitely read the directions on the project page because using this is not exactly trivial.

Status: There is an alpha release available for Drupal 7.

Session cookie lifetime

The module, created by Kornel Lugosi of Pronovix, provides an admin interface for setting the lifetime of the session cookie. This could definitely be useful for sites where convenience is more important than absolute security.

Status: There is a stable release available for Drupal 7.

StatsD

The module, developed by Owen Loy of Acquia, provides Drupal integration for StatsD and is intended for sites that have an existing StatsD / Graphite setup. It’s preconfigured to send statistics for Watchdog entries, user logins, page views, and active user sessions, but developers can also configure it to send custom statistics. It definitely looks useful.

Status: There are beta releases available for both Drupal 6 and Drupal 7.

Suggested Modules

The module, written by Kevin Quillen of Inclind allows module maintainers to enter a “suggests” property to their module info file, with a link to a relevant module project page. This is a step down from “required” modules; it simply suggests other modules one might normally wish to use in conjunction with your module. Of course, for this to work, modules both need to have “suggests” entries on their .info pages, and users need to have this module installed and enabled. I think this is a great idea and could well be an improvement in “core”; otherwise, until it’s widely used by both site builders and coders, it won’t be very useful. Actually, combining this with Module supports (which still needs a Drupal 7 release) is a more likely future development; in any case it would be helpful if we got such functionality into Drupal core.

Status: There is a stable release available for Drupal 7.

System Status AJAX

The module, contributed by Chris Pliakas of Acquia, a small module which loads the system status check via AJAX so that the admin/config page is rendered more quickly, even when some of the status checks are delayed. Nice! I’m hoping this functionality is going into the System module in Drupal 8; in the meantime, this should definitely improve the user experience for Drupal 7 site administrators.

Status: There is a stable release available for Drupal 7.

Textbook

The module, coded by the prolific Bryan Ollendyke, of Penn State University as part of the ELMS Initiative, provides Features which include CSS styles, WYSIWYG settings, and CSS3 page templates to help any theme provide consistent textbook styling for the production of online course materials. Users don’t need to be expert in CSS / HTML, but even experts should find this helps streamline their development. If you are producing an online learning site, this module, along with many others by this fine contributor, should be very useful.

Status: There is a beta release available for Drupal 7.

Timezone Picker The timezone picker module from Nate Haug.

The module, written by Nathan Haug of Lullabot, provides a JavaScript-based timezone picker to replace the default Drupal timezone list with a clickable world map to select a user’s timezone and Geolocation support for compatible browsers, so setting a timezone is greatly simplified. Enabling it replaces the default timezone list on the site’s “Regional settings” page and user profile pages. All Javascript is included; no libraries need to be downloaded and quicksketch also wrote this to be mobile-friendly. Very cool!

Status: There is a stable release available for Drupal 7.

Typo The Typo module’s user interface

The module, developed by Roman Arkharov, provides a simple way for site visitors to report typographical errors in your site content; all they need to do is select text which includes a typo and press Ctrl + Enter to automatically notify the site administrator. It includes preset Rules events you can use, as well as Views for administrators to see a list of reported typos, among other useful integrations. This could definitely be worth checking out.

Status: There is a development release available for Drupal 7.

Views fields combine

The module, contributed by Stefan Borchert of undpaul, allows you to combine the output of Views fields, separated by any desired custom text. Normally you would do this with "Global: Custom text", however if one field is optional, your output would include an unwanted separator. Once this module is enabled, you’ll have access to a new field type, "Global: Combined fields", where you can select the fields you would like to combine.

Development on Views fields combine is sponsored by undpaul.

Status: There is a stable release available for Drupal 7.

Weather block

The module, developed by Antti Alamäki of Soprano Brain Alliance, provides blocks and pages in which you can display forecasts from Yahoo Weather, World Weather Online, or weather.com and may include additional future service integrations. Drupal 7 needed more support for weather forecast integration, so it’s good to see this and I’ll certainly be giving this a try on sites where I might want a Weather block.

Status: There is a stable release available for Drupal 7.

Sep 12 2012
Sep 12
Modules of the month story banner illustration.

There are tons of new Drupal modules that got released in August; almost 200 module project pages were created. Some of them aren’t listed here because they currently have no release; some don’t even have code (yet). But a lot of very promising modules were released in August, perhaps due to the extra community involvement around DrupalCon Munich. There were even a couple novelty modules, good for a laugh if not much else: the Honey Badger module (“Honey badger don't care. Honey badger always clears cache.”), contributed by Camilla Krag Jensen of the Danish news site, Dagbladet Information, is one such module worth looking at if you need something to make you smile. The module, by Sally Young of Lullabot, “randomly swaps values of the variable table around.” Well, maybe it would if there were actually any code behind the project. Both require Bad Judgement. I suppose the latter project page could have been created for a new Lullabot training, but I’m curious what inspired Ms Jensen. Anyway, the women of Drupal came through with some laughs.

A more useful looking set of modules was also released in August by French developer, Guillaume Viguier-Just: The module is required for any of its related modules, which include Base Page, Base Article, Base Link, Base Media, and Base Apps. These modules are “… meant to be a set of features that will provide the "lowest common denominator" for building Drupal apps and distributions.” The Base modules depend on Apps Compatible, another new module from August which I think will be in very wide use before long (Apps Compatible is covered below). There are also a couple new modules for the Spark distribution (listed below), several new Drush extensions, and a number of other modules which look good for boosting developer/themer productivity.

As with previous editions of this article, all modules are listed in alphabetical order. If categories were missing on the Drupal.org project page, I’ve added appropriate categories. Additional caveat: I have not tested all of these modules and have not fully tested any of them. They are new modules and some come with new bugs, so beware.

*/ Anonymous login

The module, authored by Mike Stefanello and sponsored by Workout Spots, provides a login page with redirect to the originally requested page if an anonymous visitor to your site follows a link which requires higher privileges. The example use case is your site sends out emails with links which require a user is logged in; but subscribers to your email list get an “Access denied” when following the links (if not already logged in); a usability nightmare. Anonymous login to the rescue! Very nice.

Status: There is a stable release available for Drupal 7.

Apps compatible As well as providing methods for shared components, Apps compatible includes a collection of methods handy for developing interoperable features and apps.

The module, by Nedjo Rogers, is already reported in use on 278 sites, which shows there must be a use case for this module that was only released a month ago; I anticipate a lot more sites will be using it shortly. It helps alleviate compatibility issues between different Apps and Features caused by conflicting dependencies, etc.

Status: There is an alpha release available for Drupal 7.

Backup and Migrate SFTP

The module, by Chad Robinson, extends the very popular Backup & Migrate module with SFTP, instead of simply FTP when setting up “Destinations”. This is a GoodThing™ for security. I’ll definitely be keeping an eye on this.

Status: There are dev releases available for both Drupal 6 and Drupal 7.

Better Statistics

The module, authored by Eric Peterson of Tableau Software, extends the core Statistics module and collects additional data such as cache status and user agent without adding a lot of extra performance overhead. This could certainly be useful.

Status: There are stable releases available for Drupal 6 and 7.

Block Upload

The module, created by Alexander of ADCI, LLC, provides a simple block with an uploader for the node being viewed, so users who don’t have full “edit” permissions for the content can still upload files and images (or if all you want to do is upload a new attachment, you don’t need to open the content in edit mode). Cool!

Status: There are stable releases available for both Drupal 6 and Drupal 7.

Book Title Override

The module, written by Bryan Ollendyke of Penn State University, allows you to change the titles displayed in Drupal’s “Book” navigation so they don’t have to be an exact match to the constituent node titles. This eliminates one limitation that many might have been frustrated by.

Status: There are beta releases available for both Drupal 6 and Drupal 7.

Chamfer defaults

The module, also by Bryan Ollendyke maintains the default settings for the Chamfer theme, an Omega sub-theme with full HTML5 adaptive theme originally used for presenting online courses on the Penn State site (and another contribution from Ollendyke). It allows you to easily move defaults or your settings from one site to another.

Status: There is a beta release available for Drupal 7 and a development release available for Drupal 6.

Close Block

Categories: Content

The module, is another contribution by Alexander of ADCI, LLC. It allows users to close any block configured to be user-closable. Blocks can be configured to stay closed or reopen the next time a page with that block is displayed, be displayed a certain number of times before closing is permanent, or re-appear after a period of time. There are global settings, per-theme settings, and settings in the configuration for each block.

Status: There are stable releases available for both Drupal 6 and Drupal 7.

Configuration Interchange and Management

The module, coded by Thomas Fini Hansen of Reload!, is the first module I’ve seen which works with the new Drupal 8 Configuration Management system. Of course it’s still early for Drupal 8, so it goes without saying that all features are experimental, but this is intended to provide a simple way to save snapshots of configuration settings, roll back to snapshots, and deploy snapshots from one site to another. This could find a place in core by the time of “feature freeze”.

Status: There is a development release available for Drupal 8.

Cron Cache

The module, written by Will Vincent of Marker Seven, allows individual caches to be cleared at configurable intervals.

Status: There is a development release available for Drupal 7.

CSS Flipper

The module, written by Tsachi Shlidor, can automatically create and maintain a “flipped version” of any RTL or LTR CSS code, which can greatly streamline developing and maintaining themes. Nice!

Status: There is a beta release available for Drupal 7.

Dev Tools

The module, produced by Yuriy Babenko of Suite101, is “a collection of PHP classes and functions which help with and simplify Drupal module development”. From the looks of things, this could well be useful, perhaps especially for debugging.

Status: There is a development release available for Drupal 7.

Disable "Language neutral"

The module, written by rysmax, allows you to show only a sub-set of otherwise-allowable language options for each content-type, which means you can remove such nonsense as “language neutral” from the selectable languages for a Blog entry… Nice and simple, and most content types on most multilingual sites would probably benefit from this.

Status: There is a stable release available for Drupal 7.

Dismiss

The module, produced by Chris Ruppel of Four Kitchens, allows you to “click away” Drupal messages so that they are out of your way without a page refresh. It’s a simple module with no configuration, but it could be handy for when you are documenting the steps of a process and end up with Drupal messages displayed that might distract from a screenshot.

Status: There is a stable release available for Drupal 7.

Drupal-up

The module, written by Kosta Harlan of DesignHammer, is “a Drush extension that facilitates building virtual machines for local development of Drupal sites.” It includes blueprints for virtual machines for hosting Drupal 6–8 -based sites. Looks interesting.

Status: There is a beta release available “for Drupal 7” (presumably, like Drush, the Drupal version is not really applicable).

Drush Hosts

The module, written by Christopher Gervais of Koumbit.org, provides Drush commands for managing /etc/hosts, so you can easily add and remove entries. This definitely looks useful.

Status: There is a stable release available for Drupal 7.

Drush Issue Queue Commands

The module, produced by Greg Anderson, is a Drush extension which includes commands which help manage a Drupal project issue queue, making things simpler for beginners and faster for everyone. I’m sold!

Status: There is a stable release available for Drupal 7.

Entity RDF

The module, developed by Stéphane Corlosquet, the primary maintainer of Drupal’s core RDF, is a replacement for Drupal core RDF, which provides tight integration between the RDF mappings and Entity API and attempts to solve shortcomings of the Drupal 7 core RDF module. This is worth keeping an eye on.

Status: There is a development release available for Drupal 7.

Feeds YouTube Fetcher

The module, contributed by Travis Tidwell of AllPlayers.com and sponsored by Anglican TV, is a YouTube feeds fetcher which is able to overcome the situation where feeds are paginated, thus getting all of the videos in a feed rather than just the first 50. This could well be useful.

Status: There is a development release available for Drupal 7.

Flag expire

The module, by Joachim Noreiko, can use either the Date or Time period module to create flags which can be active for a preset period of time or which begin/end at specified times.

Status: There is a beta release available for Drupal 7.

Flatfish

The module, developed by Mike Crittenden of Drupal Connect, uses the Ruby gem, Flatfish, to help scrape HTML data and import it into a Drupal site, useful, for instance when migrating an older website into Drupal. It includes other code to help with the migration of the data. I know there are other popular modules for this kind of task, but this could also be worth keeping in mind.

Status: There is a beta release available for Drupal 7.

Icon fonts Icon Fonts can easily be changed for color, size, drop-shadows and other effects

The module, created by Gábor Hojtsy of Acquia as part of the Spark distribution definitely looks interesting. Icon fonts allow you to easily change size, shape, color, strokes and other attributes. See this CSS Tricks post about icon fonts for an example of how useful they can be as a replacement for standard icons.

Status: There is an alpha release available for Drupal 7.

Image CAPTCHA Refresh

The module, produced by Dmitry Drozdik of VolcanoIdeas, helps with one of the problems of Captcha; if the image is “too easy”, bots can parse the Captcha—too hard and humans have a hard time and might need to refresh the page a few times, which can be a real hassle if they have completely filled out a form. This brings in a feature that is missing in some Captcha plugins: the ability to get a new Captcha without refreshing the whole page and should result in less frustration for users and a lighter load on your server.

Status: There is a stable release available for Drupal 7.

Leaflet More Maps The Stamen watercolor effect and Thunderforest cycling maps are both options with Leaflet Maps

The module, created by Rik de Boer of flink, expands your mapping horizons beyond Google maps, allowing you to include maps from a variety of alternative map providers, such as the watercolor-effect maps from Stamen or the trail and cycling maps from Thunderforest. As its name implies, it also depends on the Leaflet Javascript library.

Status: There is a beta release available for Drupal 7.

LGP

The module, which stands for “Lazy Guinea Pig”, created by develCuy and sponsored by dilygent, is another developer toolset which will help you debug your Drupal code. It can write to a temporary log file, works in places where Devel’s dsm() won’t, and has a number of other features that make me think this is worth knowing about. It also includes a number of Drush commands.

Status: There are development releases available for Drupal 7 and Drupal 8.

Logic Block

The module, produced by Pat Lockley, provides a number of configuration options for blocks to allow site administrators to easily perform such actions as merging blocks, replacing one block with another in particular circumstances (e.g. if one block is empty or based on language, role, user ID, etc), and other nifty tricks. I’ve only just experimented with it a bit, but it definitely looks useful.

Status: There is a stable release available for Drupal 7.

Mobile friendly navigation toolbar

Categories: Mobile

The module, produced by Gábor Hojtsy of Acquia, is another module developed and released as part of the Spark distribution. As the name implies, it provides a better toolbar for mobile navigation. Like the rest of Spark, it provides a way for us to test and use awesome new Drupal 8 features in our Drupal 7 projects. Very nice!

Status: There is an alpha release available for Drupal 7.

Module configure links Module configure links opens the config page for a newly enabled module

The module, by Brad Erickson of ChapterThree, helps solve a typical Drupal problem, especially common when working on sites with a lot of modules: you enable a new module, but then need to search around to find its configuration page. This module presents obvious links for configuring any modules activated, for a smoother Drupal site-building workflow. If only one module is activated, it automatically redirects you to the configuration page for that module. I’ve tried it, I like it, and I’ll definitely be using it on more than just my local “module testing” site.

Status: There are stable releases available for both Drupal 6 and Drupal 7.

OpenFolio Features OpenFolio is a distribution for photographers or other visual artists who want to create a web portfolio of their work.

The module, developed by Ted Bowman of Six Mile Tech, was released as part of the OpenFolio distribution, also released by Mr Bowman in August. it contains no custom code, but handy exported content types, Views displays, Panels, and other useful bits to help streamline the process of creating an online portfolio site to display visual art. Of course it depends on Features.

Status: There is a development release available for Drupal 7.

OpenLayers Filters

The module, by Pol Dell'Aiera, provides a text filter which replaces a token representing any OpenLayers map preset with the map, right within your content.

Status: There is a stable release available for Drupal 7.

Override css

The module, authored by Wim De Craene of Jeugdwerknet vzw, provides a simpler alternative to Sweaver or Livethemer which allows a client/administrator to make simple changes to site CSS, e.g. changing the color of H1 and H2 headings, through a simple UI, without even having to know any HTML or CSS.

Status: There is a development release available for Drupal 7.

Panels Extra Styles

The module, coded by Sean Dunaway provides additional region and pane styles for Panels with full HTML5 support. Since users are also encouraged to contribute their own styles, the options should increase with time. This looks well worth trying out if you are using Panels.

Status: There is a stable release available for Drupal 7.

Pathinfo

The module, authored by Cameron Tod of NBC Universal, is a Devel plugin which displays useful information about which module and function is responsible for the page you are viewing. It links the appropriate Drupal API pages, where applicable, and displays full Krumo output for page arguments. This looks handy for those times you need to fix some issues in a Drupal site, but have no idea where things are coming from.

Status: There are beta releases available for both Drupal 6 and Drupal 7.

Required by role Required By Role checkboxes on the Tags field configuration

The module, written by Alejandro Tabares, simply adds some extra checkboxes to each field configuration form so that you can not only specify that a field is required (for all roles), but can instead specify that a field is required only for particular roles. I suppose the use cases for this are not so common, but I’m sure I’ve had at least one situation where this would have been useful.

Status: There is a stable release available for Drupal 7.

Resolve IP

The module, by Yannis Karampelas of Netstudio, is simple, but very useful for understanding what’s going on in the system log (Watchdog) entries: it resolves the hostname for each IP address so you see (for example) crawl-66-249-66-212.googlebot.com alongside the IP address.

Status: There is a beta release available for Drupal 7.

Responsive Background Images

The module, is yet another contribution in the same vein as other modules recently released by Daniel Honrade of Promet Solutions. It provides a range of rules for background image sizes, which it loads based on the size of the browser window. Phones get a smaller background image than iPads, which get a smaller image size than a full-size browser window on an HD monitor. This, of course, helps conserve mobile bandwidth which helps make your whole site more “responsive”.

Status: There is a development release available for Drupal 7.

Search API Extended String Filter Did you ever want to be able to search partial string using the search API from within views, now you can, supports all the regular (exposed) filters and also 'Starts with', 'Contains', …

The module, contributed by Jelle Sebreghts of Attiks, enables searching for partial strings with the full Views search filters.

Status: There is a stable release available for Drupal 7.

Search API stats

The module, authored by Brandon Stone of ImageX Media, provides a block which allows users to see your site’s top search phrases. Of course there is a bit more to getting this working than simply adding and enabling the module, but for a search-related module, this looks relatively easy to get working.

Status: There is a stable release available for Drupal 7.

Searchcloud Block

The module, developed by Fabian de Rijk of Finalist, is similar to Search API Stats (above). Instead of a block with a simple list of most-searched terms, it provides a block with a “cloud” of those search terms.

Status: There is a development release available for Drupal 7.

Services Entity API

The module, created by Pedro Cambra of Commerce Guys, provides integration of Services and Entity API. It was developed with the needs of Drupal Commerce users in mind, but can be used for any Drupal entities.

Status: There is a development release available for Drupal 7.

Setup

Categories: Utility

The module, developed by Stuart Clark of Realityloop, gives developers and “adventurous site builders” a way to create a script for a client with a series of steps to enter their personal data (e.g. social networking accounts, Google Analytics tracking codes, etc); information which might not have been available during the development process.

Status: There is a beta release available for Drupal 7.

Simple Editor

The module, contributed by Ki H. Kim of Urban Insight, provides an almost-completely pre-configured WYSIWYG editor, based on TinyMCE. The aim is to give users a Wordpress-like, “ready-to-use”, editor, and not to be super-flexible, but if the common use case assumed applies to you, this could be a great time-saver.

Status: There is an alpha release available for Drupal 7.

Simple oEmbed

Categories: Media

The module, also by Ki H. Kim, integrates a simple setup of oEmbed with the Simple Editor, to make it easy to add videos and other rich media to content. Like the Simple Editor, it assumes a lot of the configuration, so for less typical use cases, you might want to use the full oEmbed project, which provides additional configuration options.

Status: There is a beta release available for Drupal 7.

Taxonomy Group Fields

, by Chris Albrecht of the National Renewable Energy Lab, is a taxonomy selection “widget” intended for larger vocabularies, currently those with two levels of hierarchy (parents and children, but no “grandparents” or “grandchildren”), however the project page indicates that there is an interest in expanding to multiple hierarchy levels, among a number of other useful features. Currently, if a parent is selected, all of its children are automatically included (parent acts as “select all” for children), but the developer also indicates he would like to provide this behavior as an option, rather than as the “only way”. This module is similar to one of my favorite, not-yet-for-D7 taxonomy selection/management tools, Taxonomy Super Select. What TGF lacks (a feature in TSS) is the ability to add new terms; I think it would be cool if it supported adding a new term into any group (with role-based limits on adding new terms). But there are so many use cases for Taxonomy widgets that it’s probably best to just create a limited module that does one thing well rather than trying to be everything for everyone.

Status: There is a development release available for Drupal 7.

Taxonomy Orphanage

The module, coded by Elliott Foster of Four Kitchens, is a module that helps resolve a rather painful bug in Drupal core. If you delete a taxonomy term, references to it still are retained in entities which used it. Taxonomy Orphanage provides interfaces for cleaning up such references. Nice work, Elliott!

Status: There is a stable release available for Drupal 7.

Theme Hider

The module, authored by Victor Quinn, provides a method for site administrators to hide particular themes on sites where users are allowed to select their preferred theme. Some enabled themes might only be for admin or for special purposes, so this is a good thing to have if you want your site to be displayed nicely for everyone.

Status: There is a stable release available for Drupal 6.

tinynav.js

The module is another contribution from Bryan Ollendyke. It integrates the tinynav.js jQuery library, which converts a typical list-based menu into a select-list drop-down if the browser window is narrow (e.g. on smaller displays). It’s extremely light-weight at only 362 bytes (minimized and gzipped). This module provides a number of configuration options and was designed for use with the Chamfer theme, but also should work well with other Omega-based themes (what it’s been tested with) and possibly other themes. Looks good!

Status: There is a beta release available for Drupal 7.

URL Alias Permissions

The module, written by Justin Phelan of Blackwood Media Group, “allows site administrators to set permissions to create and edit url path settings by content type”. This is certainly useful for particular use cases.

Status: There is a stable release available for Drupal 7.

User Import Framework Plus

The module, written by Deji Akala of JB Global, extends the User Import Framework to allow importing more than just the basic three fields (email, username, password) the UIF supports. This certainly looks like it could be useful.

Status: There is a development release available for Drupal 7.

Visual select file

The module, coded by Rudie Dirkx of ezCompany, is simpler than Media and easier to extend, plus it includes visuals (thumbnails) to help you select files. It uses Views and FileField Sources to help it work its magic. Nicely done!

Status: There is a beta release available for Drupal 7.

Webform Email Raw Emailing raw, unfiltered (filter_xss) data from a Webform submission can be risky, so only use this module if you absolutely require this behavior and understand the risks.

Categories: Mail

The module, contributed by Robert Bates of Phase2 Technology, provides a solution for sending raw, unfiltered XML from Webform submissions.

Status: There is an alpha release available for Drupal 7.

Webform Serial

Categories: Content

The module, developed by Peter Lieverdink of Creative Contingencies, simply “provides an auto-incrementing number field for webforms.”

Status: There is a development release available for Drupal 7.

WireDocs … a large legacy of documents in proprietary formats, such as MS Word or Excel, may discourage from moving to an online editor. Additionally, legal issues might arise if confidential files are hosted by a third party service provider.

The module, from Gottfried Nindl of OSCE, allows your Drupal site to host files in various office formats which can be opened (seamlessly downloaded and opened by a native, local application), edited, and saved (seamlessly uploaded back to the server) with a Java applet that bridges the gap between Drupal and the client operating systems. This looks like a pretty cool alternative to third-party document-hosting systems.

Status: There is a beta release available for Drupal 7.

Sep 07 2012
Sep 07

Drupal 8 Multilingual Initiative Code Sprint weekend

I took a train from Frankfurt (Germany) down to Munich the Saturday before the DrupalCon. When I joined the Multilingual Sprint on Sunday morning, many of them had already been sprinting for a full day and a number of issues were ready for review, so I dived in, observing the behavior of Drupal 8 before and after applying patches, proof-reading the patches for anything odd (e.g. typos in the documentation), discussing the issues in comments and in IRC with people who were sitting just across the room (other times actually speaking in person). By the end of the day, instead of the dozen or so people that Gábor Hojtsy, the Multilingual Initiative team lead, had expected, there were close to 50 people at the location, some joining us in the work on Multilingual issues, some working on other Drupal 8 tasks, and some who were just arriving in Munich and followed the Tweets to where we were. Luckily, the location rented for the Saturdays and Sundays before and after the DrupalCon week was big enough to accommodate all the extra arrivals.

While on the topic of the venue we used for those weekends, I’d like to personally thank Stephan Luckow and Florian (“Floh”) Klare of the Drupal-Initiative e.V. for all that they did to find a nice place that would still leave us with a budget for food and for their valiant work on stretching the food budget while still serving up excellent fare, in keeping with the fantastic meals we enjoyed the rest of the week. Instead of ordering delivery, they prepared almost everything themselves, including beautiful open-face sandwiches, fruit platters, and lovely grilled specialties at a club we went to where you can barbecue in the Biergarten.

…thanks for the huge help to the local organizers, especially Florian Klare and Stephan Luckow. They helped us manage collecting and spending sponsor money wisely with the Drupal Initiative e.V, prepared great sandwiches and fruit plates for us and even organized a sprinter party night with grill food. It was amazing to work with such helpful and flexible local organizers.
Gábor Hojtsy, September 5, 2012

Luckow and SirFiChi of the Drupal Initiative, organized the location and made us great food!

Since people were “fresh”, I think a lot of work got done on the first weekend and the Monday before the conference (more than 50 people joined us and worked on various core initiatives on Monday in the room we later used for core most conversations at the Sheraton), which also meant that issues were still fresh in our minds while we had days of sessions and conversations, so when we started sprinting again on Friday we had lots of new ideas for the tasks we were still working on. Friday’s sprints were at the Westin Grand, where there was great attendance both upstairs in the main room as well as a large room downstairs from it, where Drupalize.me hosted a core contribution workshop to ease people into the process of contributing to core. I decided to go to that workshop since I’m still pretty new to it all and found a few people sitting nearby who were I was also able to interest in some Multilingual tasks, so while the main group sprinted upstairs, we also worked downstairs. Later on, I came upstairs, and since there were not a lot of simpler tasks for “core newbies”, like myself, I took some time to sprint on a module I contributed some time back, before there was much of anything for Drupal 7 in the area of “multilingual”… and tried to make my module more multilingual-friendly. I got a few good commits and a new release out for Internal Links and also recruited a colleague to look at the code with me, provide some ideas, and become another maintainer. So I personally found Friday quite productive.

*/ First off, a sprint on this scale would not be possible without sponsors and significant on-site help. DrupalCon provided us with space on Monday and Friday, and some great food on Friday. The rest of the days would not have been doable without comm-press, dotProjects.be, Open8.se, OSINet and Acquia. The [ … ] financial sponsorships they provided paid for our weekend venue [ … ].

I continued sprinting with the Multilingual initiative at the Film Coop Saturday and Sunday, leaving mid-afternoon on Sunday to get back to the train station. When I left the other sprinters, Webchick was only finally getting some rest after her trip home and we had about 20 issues that were marked “RTBC”. In all, there were dozens of issues tackled over the weekend. For a complete overview of all the issues we made progress on, see Gábor’s post about the sprints, where you can also check out his excellent DrupalCon core conversation presentation, “Drupal 8’s Multilingual Wonderland”. There is still a lot to do in the time between now and the “feature freeze” deadline, but we made good progress in the DrupalCon sprints, so hopefully we can push on and get the rest of the critical tasks done in the time remaining.

One of the less trivial tasks I took on during the final sprint weekend was documenting the new language_select field type, which involved checking out the Drupal API (documentation) project, updating the Form API table to include a new Element column (language_select) and Property row (#languages), as well as information about these (below the table) and linking them in all the appropriate places. Currently, updating this page is a bit of a pain, but hopefully we will move to a better system for maintaining this information, perhaps even automated generation. While I’d worked on other Drupal documentation pages before, this was the first time I’d actually contributed patches to update the API, so it was a good learning experience.

If you’d like to help out with the Multilingual initiative or other core contribution, you might first want to take a look at the Drupal 8 Initiatives page, where announcements about coming IRC meeting can be seen. This page also has links to the news, roadmaps, filtered issues, and other pertinent information. Drupalladder.org is also a great place to go for lessons to help you work through the steps of being ready to contribute to Drupal core.

I look forward to seeing you all in IRC and in coming code sprints.

Sep 01 2012
Sep 01

I'm not sure how it happened, but today I noticed that Drupal's menus were behaving very oddly. After upgrading to Drupal 6 and installing several additional modules, I noticed duplicate menu entries as well as other disturbing oddities. Items I was placing into the menu were not showing up. Menu items that I moved around were apparently saved but they did not appear properly in a dropdown context. 

Looking further into it via the absolutely awesome SQLYog tool, I verified that there were dozens of duplicate entries. Some items were duplicated up to six times. It was a real mess.

The database tables involved here are menu_links and menu_router. These are two of the more mysterious tables in Drupal. I haven't had the need to spend much time with them in the past, and I know now that this is a good thing. Fortunately, you do not have to know anything about them to fix this problem. While I spent a couple hours carefully deleting items from this table, ultimately I gave up. I was able to remove all the duplicates, but the menus were still misbehaving. At this point, I just wanted to do a factory reset on the menus, but it's not so simple as flushing cache. However, that is not far from the solution.

This solution will do a 'factory reset' on your menus. You will lose any customizations you have made. However, all core and contrib module entries will be restored very nicely.

Please backup your entire database before doing any destructive database manipulation. 

Step one is to empty the corrupted tables:

In your favorite SQL client, run the following commands:

truncate menu_links;
truncate menu_router;

At this point, your site will be completely unusable. But not for long. To complete the final step, you will need to be comfortable with the Drupal admin's best friend, drush.

Simply run the following commands from your terminal (Viva tcsh!):

drush php-eval 'menu_router_build();'
drush cc menu

Now my menus are as fresh as the day they were installed.

Though I could not clearly identify the cause of this problem, I would suggest backing up your database before installing the Taxonomy Menu module

Jul 11 2012
Jul 11
Modules of the month story banner illustration.

In June 2012, there were over 160 new Drupal modules released. This article provides some coverage for the most noteworthy of those modules, at least from our point of view. As in the past editions of this article, we generally ignore modules which are only for limited use cases or which simply provide integration of commercial third-party services. We also have not tried out many of these modules and have not thoroughly tested any of them. We normally don’t list modules that seem to be far from “ready” (e.g. no actual release yet), but we can make no claims as to the stability of the modules covered. Be sure to back up your database before testing new modules that might cause pain and suffering.

I think that many might agree that some of the most significant new modules from June were Author, Edit, and Layout—released by Angie Byron and Wim Leers as part of the Acquia-sponsored Spark distribution, which aims to improve the content-authoring user experience for Drupal 8 (the current distribution and modules allows us to use these improvements in Drupal 7 and help improve them). This work is still not ready for use on production sites (“dev” releases at most), but the progress is exciting, nonetheless. And despite the fact that Acquia is sponsoring development, we can all contribute to this awesome project by experimenting and reporting our experience (bug reports or ideas about ways to further improve the user experience) and/or submitting patches. We are definitely excited about Spark!

Thanks to Sascha Grossenbacher and Miro Dietiker of MD Systems there are a number of new support plugins for the Translation Management Tools (TMGMT) which they have recently released, now providing support for translation services available from Google, Microsoft, MyGengo, Nativy, and Supertext. Each of these new modules that extend the main Translation management module are currently available as dev releases for Drupal 7.

Matt Cheney of Pantheon Systems has also recently released a number of exciting “apps” (modules which depend on the Apps module) to flesh out the feature-set of their popular Panopoly distribution; these include: Panopoly Admin , Panopoly Core , Panopoly Demo , Panopoly Images , Panopoly Magic , Panopoly Pages , Panopoly Search , Panopoly Theme , Panopoly Users , Panopoly Widgets , and Panopoly WYSIWYG. All of these new modules are still considered to be in “beta” for Drupal 7, and while some of these may work without the Panopoly distribution, I won’t cover their functionality in detail. They do appear to provide some useful enhancements to Drupal’s standard installation and what their distribution could formerly offer, so this is some significant progress and worth taking a look at if you want to provide a friendly user experience or want to keep up with the latest and greatest in development for distributions.

The rest of the most noteworthy modules are listed in alphabetical order with brief descriptions of their functionality, development status, and module categories on Drupal.org (in some cases, we selected appropriate categories if none were provided on the project page. A couple are not actual modules, but are included as Drupal “projects” also worthy of mention.)

*/ Bean Panels

The module, authored by Lee Rowlands of PreviousNext, allows Beans to be used within Panels. Very cool!

Status: There is a stable release available for Drupal 7.

Booking.com API

The module, written by Rafal W., is an API for Drupal developers to allow us to build Booking.com (hotel booking) features into our sites.

Status: There is a dev release available for Drupal 7.

Clean Comments

The module, written by Manuel Garcia, adds a bit of JavaScript to each page which hides the comment links (edit/delete/reply) so that they only appear when hovering over a comment.

Status: There is a dev release available for Drupal 7.

Community Media Header

The module, written by Kevin Reynen of makedatamakesense.com, allows you to provide header images which can vary based on site section or context.

Status: There is a dev release available for Drupal 7.

Conditional Rules

The module, from Jason Zhang of the Australian National University, allows you to provide branched conditions for Rules using “if / else” and “switch / case” so that you don’t need to create multiple similar rules just to manage basic differences in conditions. This functionality is a long time coming, in my opinion, so I’ll definitely be giving this one a whirl.

Status: There is a dev release available for Drupal 7.

Contentment

The module, written by Peter Anderson of Alma Technology, gets its name as a contraction of “content management”, which might seem odd since one might say that Drupal, itself, is for for content management. So what does it do? It provides a nicer overview of site content with tabs for each content type, links and overview of numbers of comments, etc. From what I’ve seen, these are sweet improvements for site administrators. It would be nice to see such enhancements to the content overview pages in Drupal 8.

Status: There is a release candidate available for Drupal 7.

Cryptolog

The module, from Mark Burdett of the Electronic Frontier Foundation, enhances user privacy by replacing IP addresses in site logs with randomized identifiers. Each identifier is unique to an IP address for each day, so you can still analyze site statistics (such as visitors per day). This would be useful for certain kinds of sites where user privacy might be more important, but it might also make it harder to track longer term patterns of spam posting or repeat visitors.

Status: There is a dev release available for Drupal 7.

Dropdown Checkboxes

The module, by arijit dutta of Faichi Solutions, integrates the DDCL library, to replace normal HTML select lists with a drop-down checkbox list for better usability. It would be nice to see this kind of functionality natively provided by browsers.

Status: There is a release candidate available for Drupal 7.

DrupalPro

The project, contributed by Mike Stewart of Media Done Right, is not a module at all, but definitely an interesting project for people who want to get up and running with a new Drupal development environment. It’s an Ubuntu-based VirtualBox disk image which can be run right off of a USB3 stick. It has loads of great utilities already installed, as well, of course, as a full DAMP stack. Assuming your production server is Linux-based, this Virtual box should provide a much more compatible testing environment than a MAMP/WAMP development environment. The disk image includes Drush 5, Git, Netbeans, Compass, Sass, Dreditor, and a number of other very useful utilities that can take time to set up.

Status: There is a beta release available for Drupal 7.

Drush live

Categories: Drush

The module, produced by James Silver of ComputerMinds, provides some nice enhancements for Drush. Explaining it here is outside the scope of this article, but it does look like it could be useful.

Status: There is a stable release available for Drupal 7.

Entity Property Field

The module, by Erik Summerfield of Phase2 Technology, provides a simple display field with format widgets to display entity properties as if they were normal fields (e.g. to provide a field with formatters to show the date/time updated information for a node or other entity.)

Status: There is a beta release available for Drupal 7.

Felix

The module, by Maurits Lawende of Dutch Open Projects, provides a simplified way for site editors to add a preset selection of blocks to pre-defined page regions without any need to use block administration. Cool stuff!

Status: There is a beta release available for Drupal 7.

GMap3 Tools

The module, contributed by Ivica Puljic of MontenaSoft, is a developer API for integrating Google Maps (version 3) into a Drupal site.

Status: There is a dev release available for Drupal 7.

Handy Block

The module, developed by Jeremy Epstein, helps eliminate the need for custom modules just to provide a block which relates to the current entity. It’s considered a “convenience module” for developers and themers.

Status: There is a stable release available for Drupal 7.

Image Annotator

Categories: Fields

The module, written by Peter Droogmans, helps add annotation markers to images.

Status: There is a dev release available for Drupal 7.

Image Autosize filter

The module, written by Hai-Nam Nguyen of Open Web Solutions, keeps content consistent and streamlines the editorial workflow by forcing a preset image size based on the selected image “alignment” (left/right/center/none).

Status: There are stable releases available for both Drupal 6 and Drupal 7.

Image Preset

The module, by Yuriy Babenko of Suite101, allows you to simply select an ImageCache preset for Views, DisplaySuite or other places where you might set up an image to be displayed.

Status: There is a stable release available for Drupal 7.

jQuery File Upload and jQuery Kaltura Uploader

The and modules, both coded by John Youssef of JesoX, are similar modules which provide enhanced file upload functionality and a “multi-uploader”. Both modules depend on the jQuery Update module and look similar. Differences include that the jQuery File Upload module supports non-image/video documents (e.g. .doc and .pdf files, etc), whereas the Kaltura uploader supports only images and video file-types, requires the Kaltura module, and uploads files to your configured Kaltura account.

Status: There are dev releases available (for both modules) for Drupal 7.

jQuery LocalScroll

The module, written by Gabor Szanto, uses the jQuery LocalScroll library (installed separately using the Libraries API module) and allows you to build sites with links to anchor points on a page which smoothly scroll to those anchor point links, when clicked. This can look pretty cool and is ideal for mini-sites or to minimize page requests. See the project page for links to example sites.

Status: There is a dev release available for Drupal 7.

JSON 2

The module, is also produced by Peter Droogmans and provides integration of the JSON 2 JavaScript library. This could definitely be useful.

Status: There is a stable release available for Drupal 7.

Link API

Categories: Content

The module, by Chris Skene of PreviousNext, provides some nice tools for developers to manage links on a Drupal site. This can include validation of links, maintaining a list of all links, etc. This definitely looks handy!

Status: There is a beta release available for Drupal 6 (and we are hoping this will get ported to D7.).

Link Badges and Menu Badges

The and modules, both developed by Wayne Eaker of Zengenuity, work together (Link badges is a developer API which is used by Menu badges and can be used by developers for other modules) to provide iOS-style “badges” next to links, e.g. to indicate the number of unread messages, items in a cart, etc. Very nice!

Status: There are stable releases available for Drupal 7.

Microsites

The module, also contributed by Chris Skene of PreviousNext, helps simplify using Drupal to produce “Microsites” within a Drupal installation, so they can have their own menus, etc. This looks very cool!

Status: There is a beta release available for Drupal 6.

Ming

is yet another module by Chris Skene of PreviousNext. Ming allows site developers to work with data stored in MongoDB databases and provides a number of nice features, including maintaining multiple persistent connections to MongoDB databases, shortcuts for MongoDB tasks and for accessing stored objects without need for creating full MongoID classes, etc. This looks very interesting.

Status: There is an alpha release available for Drupal 7.

Postal Code Validation

The module, produced by Liam Morland of University of Waterloo, is a developer API which helps provide postal code validation for a number of different countries. It has no user interface of its own, but allows developers to utilize its functions in their own modules.

Status: There is a release candidate available for Drupal 7.

Promo node

The module, created by Mikke Schirén of NodeOne, provides a system for promoting various Drupal nodes on your site, thus eliminating the need for creating a special “promo” content type.

Status: There is a dev release available for Drupal 7.

Publish button

The module, also created by Mikke Schirén, provides a simple “publish” button next to the “Save” button so you don’t need to force your site’s content creators to check the “publish” box, then click on “Save”. This provides a more natural workflow and helps prevent accidentally creating nodes without publishing them (or vice-versa, depending on how you might create your content type defaults.) Very simple… but very nifty!

Status: There is a beta release available for Drupal 7.

Reverse Proxy Check

The module, written by Justin Emond, helps verify that nothing has broken your reverse proxy caching for anonymous site visitors (e.g. Varnish). It provides an extra line in your site’s status report (admin/reports/status)

Status: There are stable releases available for both Drupal 6 and Drupal 7.

Rules URL Argument

The module, written by Tadej Baša, allows you to check for and get the value of arguments used in the URL and use them in Rules.

Status: There is a stable release available for Drupal 7.

SAML Service Provider

The module, by Marcus Deglos of Acquia, is pretty cool… it allows users to verify their identity with a SAML IDP (Identitity Provider) server to streamline registration and login.

Status: There is a dev release available for Drupal 7.

Scheduler Workbench Integration

The module, produced by William Hurley of Forum One Communications, allows you to set dates for Workbench-moderated content to be published and/or unpublished. This is definitely useful for managing the scheduled release of editor-moderated content.

Status: There is an alpha release available for Drupal 7.

Search synonyms

Categories: Search

The module, produced by Aidan Lister, allows you to add synonyms for search terms to the index so that, for example, people searching for “Holland” will see full search results which also include the (usually-synonymous term), “The Netherlands”.

Status: There are stable releases available for both Drupal 6 and Drupal 7.

Taxonomy add previous

The module, created by Joachim Noreiko, helps streamline the process of adding related or similar taxonomy terms by automatically populating the new term fields with the values used for the previous taxonomy term and provides a second link for this functionality next to the normal “add term” link. This could definitely be useful for certain use cases.

Status: There is an alpha release available for Drupal 7.

Views Dataviz

The module, developed by Jurriaan Roelofs, is a modern, HTML5-based data visualization system for providing charts from Views data, etc. Nicely done!

Status: There is an alpha release available for Drupal 7.

Views Rules

The module, is another contribution (like the Conditional Rules, above) by Jason Zhang of the Australian National University, which provides integration between Rules and Views. Getting into the particulars of using this module would be a separate article on its own, but it definitely looks cool!

Status: There is an alpha release available for Drupal 7.

Views Slideshow Liquid Carousel

The module, written by Jonathan DeLaigle of Advomatic, integrates the Liquid Carousel Javascript library into Views Slideshow, allowing you to provide fluid layout to a Views Slideshow, e.g. fluidly alter the number of thumbnail links visible as the window’s width changes. This looks slick!

Status: There is a beta release available for Drupal 7.

Jun 19 2012
Jun 19

It’s been a busy past several days in Barcelona (for the Drupal Developer Days) and most of us who’d been sprinting during the week before seemed to be in the same condition by Sunday—rapidly running out of energy from progressive sleep deprivation from an increasingly later return to our hotels. But it’s been an exciting week for Drupal core (and contrib) development and significant work has been completed on the Drupal core (mostly building up Drupal 8, but also some for added features in Drupal 7) while a lot of important decisions have been made which will likely shape development in a number of initiatives for the coming months until the sprints at DrupalCon Munich.

In addition to the Sprint I was primarily involved in (I was just trying to get my feet wet with assisting the Drupal 8 core development process by joining the multilingual sprint, but I did write my first committed core patch—admittedly this was a very basic patch), there were also sprints running for “Views in core”, Entity API, Media initiative, Mapping in Drupal 7, configuration management, abstracting social networking, search-related sprints, the Drupal.org upgrade… and possibly more still. I’ll cover some of the highlights of the week that I’m most knowledgeable about.

Multilingual Initiative

The multilingual initiative sprinted all week before the Developer Days sessions, and even continued through the weekend. And a lot of key decisions were made and important code changes committed and pushed to the central Drupal 8.x repository.

New user interface translation improvements in Drupal 8

This is something I got to do a bit with, but Swiss developer, Michael Schmid (Schnitzel on d.o), of Amazee Labs, was the primary developer working on this task during the Sprint. He and his colleague, Vasi Chindris, were among the stars of the week. It was a real privilege to get to look over their shoulders and to get Michael’s support when it came to using Git to manage code in the sandbox we were using for the issue. (Thank you, once again, Michael!) Once everyone was happy with the work, it got committed to core. This new sandbox workflow, used for larger issues, helps avoid a lot of bugs creeping into the main branch, as has happened during previous periods of intense core development. Of course the tests and test bots catch a lot of issues which could otherwise be major headaches for all concerned (automated testing was also a part of Drupal 7 development). If you recall, the long wait for Drupal 7’s release was due to hundreds of critical bugs. Now this should be a thing of the past since we have an established threshold for critical issues; and the core team only commit new patches to the central repository when we are below that threshold (15 “critical” bugs, 100 “major” bugs… among other thresholds specified).

New system for translating Drupal’s user interface

The new user interface translation system allows you to keep imported (community contributed) translations separate from customized translations and search for a particular translation within either or both categories as well as filter by translated strings, untranslated strings, or both. If you have any unsaved translations, they are highlighted to help remind you not to leave the page without saving them and there discussion about providing a dialogue to prevent a site admin from accidentally leaving the page with unsaved changes, too. There is also an issue to allow the string search to be non-case-sensitive (checkbox) to find more strings that contain a particular word or phrase, regardless of text case. Since this feature came up in discussion after the rest of the user-interface changes had already been made, we elected to put the discussion about adding this feature in a separate issue. If you have ideas for what might further improve the Drupal 8 user-interface translation workflow, your input is valued.Customized and imported (community) translations are stored separately

*/

New content language options

Drupal 8 has new language settings per content typeYou can enable translation for a particular content type and also choose to hide the language selector (automatically selecting the language for a new piece of content by any of a number of contextual rules). The automatically selected language for a new piece of content can be any particular language enabled on your site, “not specified”, “not applicable”, “multiple”, the “site’s default language”, the “current interface language”, or the “author’s preferred language”. While all these settings might arguably be a bit confusing for new users, they should help smooth the content creation and translation workflow for most sites. Of course the option to “enable translation” is hidden if the default language for the content type cannot be resolved to a single language (i.e. for “not specified”, “not applicable”, or “multiple”), since translation does not make sense here.

Translate the English UI to… English!

Drupal 8 — Enable English UI translationIn the edit preferences for the English language, you can enable translation to English and then it’s easy to change, for instance, the “Log out” link to “Sign out” (or “Disembark”, “Abandon ship”, “Terminate session” or anything else you might want on a particular site). Of course this could also be useful for fixing any oddities you find in the UI strings provided by contributed modules if you find a mistake in a field description, for instance, you don’t need to wait for a module developer to commit your patch or add a “site English” custom language just to modify a few strings.

Configuration Management related to Multilingual sites

Drupal core team leads and other sprinters discussed multilanguage configuration

One of the biggest issues of the week was determining how multilingual configuration would be handled in Drupal 8. The core team knew that they wanted to store language configuration in files rather than in the database, so that it’s easy to “push” new language configurations to an established site that already has content, among other benefits of this approach. But this brought with it a number of challenges which the Multilingual Initiative team, Configuration Management Initiative team, and other interested parties discussed in several sprint discussions through the week. Many of the standard configurations for a site might also differ, depending on the language: you might, for example, want a different site name or site slogan or logo for each language. There were three different proposals for how to handle multilingual configuration, and to keep a long story short, the final decision was to go with “Plan B” (or a minor variant, thereof). You can still lend your voice to the “review” process in the main issue for the language configuration system in Drupal 8. If you would like an overview of the plans, there is a nice graphic by Gábor Hojtsy (the Multilingual Team lead) which outlines the differences between the three proposals and some variants.

Drupal 8 Configuration Management

Greg Dunlap (“heyrocker” on drupal.org) presented the new configuration management

Angie Byron, aka “webchick” gave a quick overview of the configuration management initiatives goals, tooOne great session from the weekend was the Introduction to the Drupal 8 Configuration Managment System by Greg Dunlap (“heyrocker” on Drupal.org), the Configuration Management Initiative team lead. There has been some good progress in determining what this is going to look like, some of which took place during the sprints in Barcelona. Basically, this will be a bunch of smaller files stored within a logical directory structure in the sites/[…]/files directory. The new configuration system is currently planned to be YAML-based (rather than PHP or XML, which were used in earlier visualizations of the system). And the goal, as described by a slide in Angie Byron’s Sunday-morning keynote, “Drupal 8: What you need to know” is to be like “Features in core, only better”. The aim is to help us remove the complications involved in pushing configuration changes, modified in a development or staging environment, to a site that already has user-created content that we don’t want to lose. The main problem with the current system is that there is no consistent system: configuration settings are scattered across multiple tables, variables, files, and other locations and there is no consistent structure in any case. The idea is now to have a contexts, which Drupal responds to, when determining which configurations files to use.

Angela Byron (“webchick”) talks about the problems the new configuration management system aims to solve

What it should look like when loading a configuration from module code, is something like this:

  $config = config('image.style.large.yml';
  $config->get('effects.image_scale_480_480_1.data');

And when setting and saving configuration data:

  $config = config('system.performance');
  $config->set('cache', $form_state['values']['cache']);
  $config->save();

The YAML code for the image example, which saves configuration for the “large” image style would look something like this:

  name: large
  effects:
    image_scale_480_480_1:
      name: image_scale
      data:
          width: '480'
          height: '480'
          upscale: '1'
      weight: '0'
      ieid: image_scale_480_480_1

This should be pretty easy for developers and site builders to learn to work with and of course an interface is planned which should automatically build the configuration files, when edited by site builders. Configurations will be loaded into the “active store”. Changes are saved back to the active store and back to the YAML files so they can easily be moved between sites (staging and production sites, or completely different sites if they should have some settings in common). Building up an ideal import/export system for configurations is one of the major remaining hurdles. Update: heyrocker’s presentation slides are now available for download, so you can see other examples of Drupal 8 configuration.

Other Drupal 8 news

Twig library committed to core!

Drupal 8 now has Twig in the core/vendor directoryOne of the new developments which has received some press is that Twig, the templating system designed by Fabien Potencier, the innovator behind Symfony, which also bundles Twig, has now been added to the Drupal core repository.

However, the fact that the Twig library is in the repository does not mean that it’s ready for any kind of use yet, except for those who are working to build a new templating engine for Drupal, which uses it. How this works is still open to discussion; according to webchick, it may be that we keep both PHP-based and Twig-based templating engines to ease the pain of this change. On the other hand, while there is a learning curve involved, there are many advantages to Twig, especially in terms of security (removing PHP vulnerabilities from themes, altogether), and the saying that “the drop is always moving” applies here. It may be that Twig is the only templating engine which will be supported by Drupal 8, but if you feel strongly about this or have ideas for how to do this “right”, it’s a good time to get involved.Twig vs PHP template syntax

Context-based layout and blocks

Angela Byron lays out the plan for Drupal 8 layout with contexts

Everything in Drupal 8 will be a block or a layout area and blocks can have multiple contexts which determine their behavior (and whether or not they are displayed). This is going to be a major change which should produce much more flexible layouts and site designs. Of course this will touch on every major Drupal initiative: configuration, HTML5, mobile, multilingual… all are involved.

Drupal 8 will have clean, semantic HTML5 (and will abandon IE)!

Say goodbye to the messy nested div hell! Drupal 8 code is going to be much smaller and cleaner which will make designer/themer types love Drupal and make it possible to produce code that renders nicely, regardless of display size. Oh, and don’t worry about trying to support older versions of Internet Explorer; the community has decided it’s time to put that tiresome task to rest. Yay!

Drupal 8 development needs you!

Webchick, heyrocker, Gábor Hojtsy… all made the same point: As a community effort that’s still underway, the Drupal 8 effort needs more of the community at large to get involved and find ways to help out. There is a lot of complexity, but there will be smaller tasks that anyone could work on, so there’s going to be something for everyone. Even non-coders can help by testing, filing bug reports, helping manage the issue queues, making suggestions, documenting finished features and APIs. There are several places where you can get involved:

  • The core initiatives overview page provides information about when the different teams meet in IRC and in which channels among other information which can help people who want to find ways to get involved.
  • Drupal Ladder is a project aimed at helping more people learn how to contribute to Drupal
  • [ … ] (Comment below if you have other tips for where to get involved)

Big thanks to the organizers, sprint leads, and session speakers

The Drupal Developer Days in Barcelona were a big success because of all of you pulling together to make things happen. The local organizers made us all feel welcome and provided a lovely venue and took us out on the town just about every night. The sprint leaders helped find ways for everyone to play a part in building Drupal 8 or contributing in other ways, and the sessions were awesome.

Jun 11 2012
Jun 11
Modules of the month story banner illustration.

In May 2012, 150 new Drupal modules were released; this post provides an overview of some of the most promising modules including developer APIs, theming tools, configuration assistants, useful enhancements to other modules and much more.

Going through the list of new modules, I found it difficult, this time, to select the “most useful”. Of course what seems “useful” depends largely on ones use case, so what you find indispensable, I might I find useless today, and tomorrow I might decide it’s a vital part of my new project. With one exception, the selected modules should all be reasonably “ready for use” (i.e. they at least have a release of some kind) and are mostly modules I could imagine using, myself, even if I don’t have an immediate need for many of them. Some modules which were not included in this selection include several "third-party integration” modules, especially those for “commercial” services. And in contrast to the post made for the April’s “modules-of-the-month”, I have not attempted to sort the selection of modules by category, but instead have the list sorted alphabetically, by project name—the summaries include the categories used on the modules’ Drupal.org project descriptions (and reasonable categories have been added for a few modules which currently haven’t got any categories selected on drupal.org).

As with last time, I have not been able to personally test all of the modules, so don’t blame me if you enable one that looks promising… and it hoses your database.

*/ Addressfield Tokens

The module, by Andrew Marcus of New Signature, has already got over a hundred sites using it, so clearly this was an innovation that people had been waiting for. It’s a nifty extension to the Address Field module (so obviously depends on that) which also requires the Entity Token sub-module (part of the Entity API module). A token such as [addressfield:full] can be used to insert (in this example) a full, formatted address. It integrates well with MailChimp and Webform.

Status: There is a stable release available for Drupal 7.

Apache log4php integration

The module, by Erik Webb of Acquia, like most modules from Acquia, is complex enough that it’s not easy to summarize; that said, this module provides integration with the Apache log4php™ library to simplify the process of logging errors. It’s a “better watchdog” that uses a common-purpose library to log messages to a wide variety of backend logging systems with improved control compared to Drupal’s standard message logging (Watchdog) system. You obviously need to install the log4php library (using PEAR or the Libraries module)

Status: There is a dev release available for Drupal 7.

Article Templater

Categories: Content

The module, by John Youssef (JesoX), sounds like a great idea (caveat: I’ve yet to actually experiment with this). It provides savable structure for any content type body, including snippets, etc, so if you have a particular article format it can be easily inserted into your body field. It supports CKEditor and Wysiwyg.

Status: There is a dev release available for Drupal 7.

Block Conditional Visibility by URI Query Parameters

The module, written by Solomon Gifford, extends the normal controls for where a block is displayed to allow blocks to be shown (or hidden) if a particular query string is appended to the URL, e.g. https://example.com?referrer=google. Tres cool!

Status: There is a stable release available for Drupal 7.

Colorbox Node

The module, produced by Dennis Blake, allows you to display any page (minus header and footer) within a Colorbox modal. Despite the word “node” in the module name, it supports user pages, Views pages, Webforms, and more.

Status: There is a stable release available for Drupal 7.

Commerce Fancy Attributes The example color selector for Commerce Fancy Attributes

The module, developed by Julien Dubois and Bojan Živanović of Commerce Guys, provides a Javascript-enabled way to change the boring, ugly radio button set into a prettier selector. The example use case is a color selector used on a product’s “add to cart” form with nice color swatches to click rather than labeled radio buttons. But if Javascript is disabled, it gracefully degrades to normal radio buttons. Nice!

Status: There is a beta release available for Drupal 7.

Compass: Commerce Dashboard & Analytics Compass is my effort to turn Drupal Commerce data into comprehensible information.

The module, authored by Jurriaan Roelofs, provides nice visualizations in the form of graphs and charts of your Drupal commerce data using interactive HTML5/VML Google Charts with views integration. It has a long list of dependencies, but most of these will already be in use on a complex Drupal Commerce-enabled site.

Status: There is a alpha release available for Drupal 7.

Cookie Log

The module, produced by PK Vaish of Livelink New Media, provides a simple record of all cookies set by your site so that you can better audit cookies for compliance with the new EU “cookie law”.

Status: There is a stable release available for Drupal 7.

Corresponding Entity References As this is the next evolution of Corresponding Node References, I would like to say thanks for all the work done over on Corresponding Node References. This is almost a direct upgrade from CNR to include handling of entities.

The module, by Chris Hertzog of CODEwork Designs, allows two entity types to have references to each other which are automatically automatically updated if changed in one of the entity instances.

Status: There is a dev release available for Drupal 7.

Create-editor The development has just started and the module is not yet usable, we are just testing the concept and a complete rewrite will probably occur once we know how to deal with everything. All help is welcome.

The module, written by Finish developers Roni Kantis of Soprano Brain Alliance and Riku Virta, the front-end developer of the actual Create library, is the only project listed here which does not yet have any kind of usable release. Despite not yet being usable and being in the early stages of development, the goals of this project are so impressive and worthy of continued interest, that I felt it deserved mention. Create, from the Midgard Project allows you to integrate the browsing and content editing user experience to allow editing without going into a “content administration” form. So you can easily change content directly on a page and submit changes back to the server. I’ll certainly be keeping an eye on this.

Status: There is no real release available yet (but you can download the current state of the project as a development snapshot or check out the project with Git).

Data Visualization Wizard

The module, written by Jason Hoekstra of the U.S. Department of Education, has a goal to simplify and streamline the process of creating complex data visualizations in Drupal.

[…]Views, OpenLayers, Charts and Graphs and others provided a quick way to show data online without custom programming, but became a maintenance burden in the long run, often taking 8-32 hours to create a new visualization. For this reason, we distilled the best practices from these patterns into a single module. The end goal is to lower the technical complexity required to create new visualizations and decrease the time required to do so.

Status: There is a beta release available for Drupal 6.

Entity Reference Count

The module, written by Pablo Cerda of BlueSpark Labs, is an entity-based adaptation of the Nodereference Count module, which allows you to add an automatically-calculated field to any entity which will display a value for the number of other entities which reference it.

Status: There is a dev release available for Drupal 7.

Exclusive Value

The module, by Robert Castelo of Code Positive, is a module which provides a basic checkbox field (boolean setting) which can be enabled for any one node to make it the featured node. When the checkbox is set on one node, it is unset for all others (only one node is featured with this setting). While this might not be useful on every Drupal site, I can certainly think of situations where I would definitely make use of this simple module.

Status: There are stable releases available for both Drupal 6 and Drupal 7.

Fallback language negotiation Change the Default language without changing the default language by using a other language as fallback.

The module, coded by German Drupal developers, Florian Weber of [di] digitale informationssysteme gmbh and Dennis Brücke, has a funny description (see quote to right). I’ve not had a need for it yet, but I’m sure it’s useful for some situations.

Status: There is a dev release available for Drupal 7.

Google Viewer file formatter

The module, by Janez Urevc of Delo, integrates the Google doc viewer to display a number of different document types (.pdf, .doc, .docx, .xls, .xlsx, .ppt, etc). It requires enabling the File entity module.

Status: There is a stable release available for Drupal 7.

LimeSurvey Sync

The module, contributed by Julien Duteil , provides integration of LimeSurvey results into a Drupal site.

Status: There are stable releases available for both Drupal 6 and Drupal 7.

Log Em Out

The module, from Minnur Yunusov of Urban Insight, prevents multiple concurrent sessions from different IPs on the same user account by automatically logging out any previous connection if a user logs in from a different IP. For membership sites this could help prevent sharing of accounts and it should also help ensure security. In permissions, you can select which roles this behavior is applied to.

Status: There is a stable release available for Drupal 7.

Lorempixel

The module, contributed by Fredric Bergström of NodeOne, brings improved “placeholder image” creation to Drupal by accessing free images on lorempixel.com, which can be “generated” at any image size needed. It integrates with Devel generate, but can also be used to add an image as a file entity.

Status: There is a dev release available for Drupal 7.

Node Field

Categories: Fields

The module, contributed by Alexander of ADCI, LLC, allows you to add unique extra fields to individual Drupal nodes without needing to add the fields to the content type. This provides a lot of flexibility and helps prevent excessive “field clutter” or the need for more content types.

Status: There is a stable release available for Drupal 7.

Node View Permissions

The module, was (like Node Field) also developed by Alexander of ADCI, LLC, provides Drupal 7 with the permissions: "View own content" and "View any content" for each content type, just as it was in Drupal 6. This could be especially useful for D6 sites which made special use of these permissions and now need to be upgraded to Drupal 7.

Status: There is a stable release available for Drupal 7.

OG Extras

The module, contributed by one of the Drupal community’s superstars, Karen Stevenson, is a set of “extras” for Organic Groups. It’s especially useful for sites which don’t use Panels since it provides Views and Blocks for Organic Groups which don’t depend on Panels.

Status: There is a stable release available for Drupal 7.

Panels Frame

The module, written by Helior Colorado of Commerce Guys, gives Panels users a simpler way to build new complex layouts by stacking existing Panels layouts. Cool!

Status: There is a alpha release available for Drupal 7.

Pathauto i18n Taxonomy

The module, by Marco Kleine-Albers, provides i18n tokens for taxonomy paths in Pathauto so users get paths in their own language. Of course this is also good for SEO.

Status: There is a beta release available for Drupal 7.

Popcorn.js

The module, written by Kevin Reynen of makedatamakesense, integrates the cool media viewer, Popcorn.js, which includes support for YouTube and Vimeo as well as other interesting HTML5 applications.

Status: There is a dev release available for Drupal 7.

Portable path

is a module, from the great Jim Berry, which helps make it easier to move a site from a development/staging domain to “production”.

After a review of existing input filters and related modules, none seemed to do this. Some remove the domain portion of the path, making the path portable in certain contexts but not across all use cases. But none finished the job by replacing the file structure path. If someone is aware of a module doing what this does, let me know.

Status: There is a dev release available for Drupal 7.

Reviews

The module, written by Scot Hubbard of Base One Ltd, simplifies adding reviews to site content. Reviews can be configured per content type. For those of us who have had to jump through hoops using the Voting API paired with node references and creation of a “review” content type, this is definitely a breath of fresh air and I am betting the Reviews modules will quickly grow in popularity!

Status: There is a stable release available for Drupal 7.

Role Delay

The module, created by World Fallz, allows a Drupal site to automatically promote a user from a basic “Authenticated user” role (which might not have many permissions at all) to a more trusted role after a period of time and then further promote their permissions (role) after another period of time.

Status: There are stable releases available for both Drupal 6 and Drupal 7.

Save Form State

Categories: Content

The module, coded by John Youssef of JesoX, provides “autosave” functionality in Drupal forms. Woohoo! You’ll need to add some additional jQuery libraries and do a bit of configuration, but this definitely does look promising.

Status: There are dev releases available for both Drupal 6 and Drupal 7.

TagCanvas tagcanvas.png

The module, written by Chin Kiong Ng of MyFineJob.com, integrates the TagCanvas library, which uses the HTML5 Canvas to build one of those fancy new 3D animated tag clouds, similar to what Cumulus does, but without using Flash (thank God!). It depends on the Tagadelic module, used by over 30,000 Drupal sites and I can only imagine that TagCanvas could quickly gain thousands of installations.

Status: There is a stable release available for Drupal 7.

Template Field Variables This is a utility module for themers. Its only purpose is to make Drupal template development less painful. It has no front-end. It stores no data. It implements no hooks.

Categories:

The module, by Jeremy Epstein, is a nifty new theming tool which takes the pain out of theming fieldable entities. Variables hidden in the massive nested arrays are moved into simple variables. It works on all core content types and fields as well as many fields and content types provided by the most popular contributed modules (link, email, date, reference, etc). This should make theming a bit less headache and a bit more fun. Yay!

Status: There is a stable release available for Drupal 7.

Tooltip Field Formatter

Categories:

The module, developed by Marc van Gend, uses BeautyTips to provide a nice display of field contents when you mouse over an appropriate icon or other trigger. Nicely done, Marc!

Status: There is a beta release available for Drupal 7.

Users Export

The module, created by Aaron Klump of In the Loft Studios, is a lean module with basic features for exporting common fields from the user table into common formats (e.g. CSV). It has an API which developers can use to extend the set of fields that it can export.

Status: There is a stable release available for Drupal 7.

Views iCal

The module, developed by Max Rakhimov, allows you to create iCal feeds of events from Views, simply and easily.

Status: There is a beta release available for Drupal 7.

Workbench Moderation Notes

Categories: Utility

The module, by Kevin Miller of Cal State Monterey Bay, provides a “Notes” field to display comments attached to changes in the moderation state of content revisions managed by Workbench Moderation; it improves communication in the editorial workflow process.

Status: There is a dev release available for Drupal 7.

Xtools

The module, by Bart Feenstra, is yet another module for to help developers test the modules they are writing. It allows developers to create “blueprints” against which input and output is checked. I look forward to see how this develops and to giving it a go.

Status: There is a dev release available for Drupal 7.

Jun 04 2012
Jun 04

It’s considered “best practice”, if a module creates any variables, to delete those variables in the module’s uninstall function. Before Drupal 7, this was done in a call to db_query(). But with the “new” DBTNG (Drupal 7 Database API), using db_query() is no longer recommended. See the documentation for db_query():

Do not use this function for INSERT, UPDATE, or DELETE queries. Those should be handled via db_insert(), db_update() and db_delete() respectively.

However, browsing through (a relatively small set of) Drupal modules I have for my local Drupal 7 installations, I still see a number of modules which are using db_query to delete variables, typically something like this:

<?php
  db_query
("DELETE FROM {variable} WHERE name LIKE 'some_module_%'");
?>

Let’s rewrite this fictional module’s call to db_query() to instead use db_delete():

<?php
  db_delete
('variable')
    ->
condition('name', "some_module_%", "LIKE")
    ->
execute();
?>

But there is another problem with this code. Which is? That’s right… it uses a wildcard that might apply to another module’s variables. What if someone else writes a “some_module_extended”, “some_module_plus”, or “some_module_rethunk”*? Then our db_delete() function call will delete variables from those modules, too. This is not at all a stretch of the imagination with modules that provide an API or which are widely used and might get forked. So what is better practice? Well, of course if your code is aware of the names of all your variables, you could easily loop through an array to remove them. Or, if your module dynamically creates variables based on user input, you could store the names of these user-created variables in another variable, then do the looping. Or, of course, you could also create your own table to store your module’s “variables” and that table would automatically be dropped whenever your module is uninstalled.

Another point worth bearing in mind—I don’t see all modules taking care of this—is that when you delete variables it is good to also clear the variable cache. Only some of the modules which delete variables using db_delete() seem to remember this:

<?php
  cache_clear_all
('variables', 'cache_bootstrap');
?>

But the best practice is to use variable_del()

Of course you would be best off looping through all your variable names using variable_del(), which also automatically clears the variable cache. If you know the names of all your variables (or can store them as dynamic variables are created), this would most certainly be “best practice”. It will also remove the deleted variable from the global $conf array.

Updated:

To clarify and correct code, as suggested in comments, below.

* The former English (as a foreign language) trainer in me requires me to add the following caveat: 'thunk' is not a word in proper English (nor is 'rethunk'), but Oxford English Dictionary defines it: “informal or humorous past and past participle of think” : : who would've thunk it? (Just so's yah knows I ain't totally illegiterate. ;-) )

May 02 2012
May 02

April 2012 delivered a fresh batch of promising and useful-looking new contributed modules to the Drupal world. Perhaps because the immediately-preceding DrupalCon gave developers some time to collaborate and work on their contributions more than they normally might, this month seems to have a notable number of interesting new projects, especially considering the relatively “mature” state of Drupal 7 at this point. To help keep abreast of some of the most interesting new developments we have planned a monthly article to showcase these new modules; this is the first edition of our “Modules of the Month”. At this point in the release cycle, newly released modules are mostly only being released for Drupal 7, but a few have also been released for Drupal 6 as well; where Drupal versions are not mentioned, you should assume the module is only for Drupal 7.

Caveat: I have tested some, but not all of these modules. Be especially careful if you choose to use any of the “pre-stable” releases on production sites. I should also note that some other awesome modules released in April may not be included—I did my best to select the modules I’d be most likely to use, but there are some “special use case” modules which were not covered, but which might be very useful for some sites. The 30-something modules included here have been sorted into very loose categories.

3rd Party Integration / Social Media

Twitter Follow Block

The Twitter follow block

The Twitter Follow Block module, by Pradeep Saran, provides a nicely styled box to show your Twitter link and followers in a jQuery-loaded block that can be placed in any region of your theme. You can configure the dimensions of the block (and thus, the number of “follower thumbnails” displayed) and you can choose from different color schemes to better match your current theme. It currently only displays the Twitter feed for one Twitter user, but what might be an interesting development would be a way to dynamically load the Twitter username (e.g. from a Profile field) so that the Twitter follow block would link to different users (based on the author of content currently viewed or the profile page being viewed, if applicable). The module is currently available as a “stable” 7.x-1.0 release and I look forward to seeing this get further developed.

Social Buttons

The Social Buttons module by Linnovate’s Raz Konforti, provides a field that can be added and configured for any content type (or any fieldable entity) and includes default button code for Facebook, LinkedIn, Twitter and Google+, but you can also easily add new buttons. Since it’s a field, you can also determine where and whether it is shown for each display (node view, teaser, RSS, etc). It has a 7.x-1.0-beta2 release as well as more recent commits to the developer branch.

Content Access Control

Hidden Nodes

The Hidden Nodes module, created by Bryan Ollendyke of Penn State University, helps allow staff to hide nodes from regular visitors while still allowing users with “staff” permissions (admin or author/editor -type roles) to see the content in the menu as it will appear when the content is finished. This helps get around the issues caused by the “black-and-white” absoluteness of published/unpublished status (and only being able to access content through the “administer content” system). It was created to integrate well with the Outline Designer module, another project sponsored by Penn State. Hidden Nodes has recently had its fourth beta release and is certainly an interesting project for streamlining team-based content workflows.

Restrict node page view

The Restrict node page view module, authored by Christian Johansson of Sweden’s Kodamera AB, helps prevent users from viewing content outside of its intended context. The example use case for this module involves a requirement to prevent users from directly viewing Views slideshow nodes (via their node/xxx paths), but of course there could be other content you want to restrict access to but still have its information available in a Views display, so direct access to the node by most roles can easily be blocked with this module. The initial release is shown as “stable”, and it’s simple enough, so may never require any fixes or updates. That said, I do hope that they modify the module so that full-node access is only restricted to selected node types (i.e. blacklist). It currently adds a set of permissions for all node types, which defaults to no view access for all roles and content types, which would be a pain on sites with lots of roles and content types, especially if the goal is only to restrict non-staff access to one limited node type out of many.

The permissions created by the Restrict Node Page Access module.

Node access book

The Node access book module, by the prolific danielb, is a content access module which allows access settings placed on a parent “book” page to apply to all child pages of that book; or, similarly, if content includes a reference to another node to which they have access. It makes it easy to change access to a whole Drupal “book”, according to roles. The module is still new and very experimental, so you should use it with caution; at this time the only release is a development snapshot.

Theme Enhancements

Content Theme Code

The Content Theme Code module, developed by Josh Lind, helps with performance by only delivering JS and CSS from your theme if you are on a content type or node which requires it. This makes absolute sense to me as I was originally baffled when looking at the code of Drupal-delivered pages, wondering why so much CSS and Javascript that was only used on limited parts of a site was part of what was loaded for any other page. Streamlining content delivery is especially important in these days of increasing need for mobile support, with slower and more expensive bandwidth. I understand this functionality is planned for Drupal 8, but until then, we should consider modules like this to help lighten the load on the server and improve the for users on lower-bandwidth devices. There is currently a stable release for Drupal 6 and a release candidate for Drupal 7.

Autoload JS

The Autoload JS module, authored by Justin Dodge, provides for particular JS files to be loaded according to their filenames. Labels added to the Javascript filenames or used in the path (directory names within your theme folder) can determine JS to be loaded on blog pages, your site’s front page, all pages, etc. For example, the file found at sites/all/mytheme/js/nodetype--blog.js would automatically be loaded only for page loads for the “blog” content type. A “stable” 7.x-1.0 version was released in mid-April.

Twig template engine

The Drupal Twig template engine module, by Steve Mokris integrates the Twig PHP template engine, an exciting, new-generation template system for PHP which is faster, more secure, extensible, and uses compact code which is easy to read and to learn. Twig is another awesome innovation from Fabien Potencier, the creator of the Symfony framework (of particular interest since Drupal 8 will incorporate a number of key Symfony components). It has a stable 7.x-1.0 release and should be worth experimenting with and keeping an eye on.

Fields

Field Extractor

The Field Extractor module, by Commerce Guys’ Bojan Živanović, allows you to easily get information from a referenced entity (e.g. within a Views display). This looks very useful and I look forward to seeing a “stable” release (the module is currently only available as a “developer snapshot”).

Hierarchical Term Formatter

The Hierarchical Term Formatter module, by Hannes Lilljequist, provides additional formatting options for a term reference so that you can display its hierarchy (on, for example, a node display), with “parent > child” rather than simply “child”. It provides a number of options to control the levels of hierarchy displayed, the markup used for display, and whether or not the terms are linked to “term pages” and at this time is available in with an “alpha” release for Drupal 7.

Token formatters

The Token formatters module, by super-contributor Dave Reid, enhances your control over how fields are output, by providing token support for field display formatting. This module has a beta release available for Drupal 7.

Google Map Field

The Google Map field module, by Scot Hubbard, provides a simple way to add maps to any fieldable entity with a relatively light-weight system compared to Location/GMap -type implementations. The location and zoom level for each map is independently selectable, directly from a map. It also provides an option to add the map within your Wysiwyg content by providing a simple map selection button (which inserts a custom token) that can be enabled for your editor; so you could potentially have several maps displayed within, e.g., a blog post. There are a few rough edges, but this looks like a promising way to embed maps, directly within content, without all the overhead of using other methods.

Search

Defacto

The Defacto module, by Acquia’s Christian Yates, extends ApacheSolr search to provide biasing on content which has been tagged (using a specific taxonomy reference field) with a particular term, e.g. searches for that term will be biased in favor of content tagged with the term. You can also mark specific content as the “canonical” (default) result for a search on a particular term to push the content to the top of the search results. This is a very new module, which currently only has a developer snapshot available, but it does look promising.

Administration and Content Management

Content Menu

The Content Menu module, by Wunderkraut’s Daniel Nolde (also the local “sitebuilding” track chair for the upcoming DrupalCon Munich), provides a system to streamline the process of working on menus and the associated content in one simple interface to make “building a structure-oriented website [ … ] effortless and intuitive”. Getting into the specifics of how this works is outside the scope of this article and since it’s also currently only available as a developer snapshot I will only say that this module looks very worthy of notice.

UUID Redirect

The UUID Redirect module, by David Rothstein, sounds like a very useful module for a rather complex use case: If you use the Deployment module to stage content to your production site, and use the Universally Unique ID module, UUID Redirect allows you to configure administrative “edit” links on the “production” site to link to your “content staging” site’s edit page so that certain content types (or any other entities) are only ever edited on the non-public-facing server. This module currently only has a 7.x-1.0-alpha1 release.

UUID Entity Autocomplete, Context UUID, and UUID Link (three related modules)

The UUID Entity Autocomplete module, by Dave Hall, provides a simple autocomplete/lookup field for Universally Unique IDs. It is a dependency of Context UUID, also recently released by Dave Hall, a module that “provides a context condition so reactions can be based on a collection of entity UUID—so they remain consistent between environments” (of course it also depends on Context and UUID and would normally be used in a situation where the Deployment module is used to stage content between “administrative” and “live” servers.) Finally, the UUID Link module, also by Dave Hall, provides a link field based on a UUID, which means that links won’t break when content is deployed to a “live” server. At present, all three of these modules have 7.x-1.0-beta1 releases.

Views

Views arg parent term

The Views arg parent term module, by David Langarica Lorenzo, provides a simple Views plugin which allows you to access a parent taxonomy term in order to display more “related content” than might be shown through the child term. It currently has a “stable” 1.0 release for Drupal 7.

Views argument cache

The Views argument cache module, by Mike Stefanello, allows administrators to configure individual caches for each argument in a Views display so that you only need to clear a particular argument’s sub-cache when relevant content has been added. This should help boost your site’s performance, especially for sites with a lot of content displayed with argument-enabled Views.

Content/Filters/Editors/Multilingual

Link Title

The Link Title module, by Rolf Meijer, is a text filter which can be enabled to add a “title attribute” to any link created which does not include a title, e.g. those automatically generated by the “convert URLs” filter. The added title attribute is taken from the HTML header of the linked resource. It currently has a “stable” 7.x-1.1 release.

Context Set Message

The Context set message module, by RJ Pittman of Phase2, allows your site to display a user message based on the current context. It supports a variety of tokens for more dynamic messages and depends on the Context module. The current release is only in an “alpha” stage, but this looks like a promising and useful module.

Media Gallery Extra

The Media Gallery Extra module, by Sergio Martín Morillas, extends the Media Gallery module (surprise, surprise!) to provide a number of extra useful features. There is only a development snapshot available at this time, but the features which have already been implemented look like a great start and we can only hope to see the planned features and roadmap implemented without issue. If you are planning to use the Media Gallery module to display images or videos on a new website, you might want to keep an eye on development here.

Internationalization contributions

The Internationalization contributions module, by Jose Reyero (who also happens to be the primary committer to the Internationization module) provides additional sub-modules which can be enabled to provide extra i18n functionality, e.g. synchronizing node references across different translations of content and adding "hreflang" attributes. It’s still a development module and likely will remain that way (presumably this module is a place to experiment with new features before rolling them into the main i18n module.) But if you have urgent need for these features, the new submodules could be stable enough for use, provided you carefully check them out, beforehand.

Performance

pjax for Drupal

The pjax for Drupal module, by Hannes Lilljequist, uses jQuery’s pjax library to load new content into a browser window without fully redrawing the page. It correctly updates the page title and URL path and loads any new content with a smooth process, lessening load on the server and lowering bandwidth that need be transferred, so is especially useful for delivery to limited-bandwidth mobile devices. The module is still only in a “development” state, and has a number of limitations which you should examine before use, but I think you will agree that there are some cool ideas going into this development and it is worth watching.

Variables that suck less

The Variables that suck less module, by beejeebus, is partially described with the caveat: “This module requires a core patch, and can break your site and eat your lunch.” That said, if you need to resolve some site-crashing variable cache-clearing behavior and boost performance, and don’t mind “killing kittens” in the process, this module might be helpful. It’s currently got a 7.x-1.0-beta3 release.

Fast Private Downloads

The Fast Private Downloads module, by beejeebus, provides a Node.js -enabled method to improve the performance of private downloads in Drupal. It’s still in an “alpha” development state for Drupal 7, but looks interesting, especially if you already have Node.js set up on your server for other features.

Other

jReject

The jReject module, by Domenic Santangelo, allows a site to present a “your browser is out of date” message with download links for recommended browser versions if a user visits using an older browser version. Most such modules simply target Internet Explorer, but this module allows you to recommend a newer version of any browser which has older versions that might not support the cool features your site includes. It has a stable 7.x-1.0 release.

env

The env project (not actually a “module”, per se), sponsored by NPR and authored by Irakli Nadareishvili, improves the ease of creating a portable environment-dependent set of configurations for Drupal so that you can easily have multiple configurations for dev, staging, and production sites, etc. Be sure to read the installation instructions, since this is not installed the same as “other modules” and requires changes to your settings.php file and additions to your sites/default directory.

Genova

The Genova project, by blueMinds, is not an actual module; it’s a Drush utility which helps developers provide a “stub” for the creation of new modules, creating basic files, implementing hooks, database schemas, etc. The aim is to streamline all the boring, repetitive aspects of creating a new module to allow developers to focus on the important logic. It’s still only available as a development snapshot, but what’s been implemented and what’s planned provide enough hints of coming awesomeness that we should plan to keep an eye on this.

Subs

The Subs module, by Alex Weber, helps create subscription services to a website’s “premium content” with a broad range of features (e.g. useful subscription duration preset defaults, integration with Devel, Drush, Features, Rules and Views, automatic expiration of subscriptions, grace periods, etc.) Its only dependency is the Entity API (integration with aforementioned modules would obviously require having those available and active, too). If you are planning to build a paid-subscription service-based site this module could be exactly what you are looking for to streamline some of the involved business logic. The current version is a 7.x-1.0-beta2 release.

Mar 30 2012
Ela
Mar 30

We have a major upcoming project here at Cocomore which is in the initial planning phase. It’s too early to provide the finer details of the project, but it involves creating a product database for a large publishing house and Drupal 7 has been chosen as the project framework. By mid-June, we will likely have four developers working on it, full-time. Of course, anyone who deals with software development almost certainly knows the problems that tend to occur during the planning of large-scale, long-term projects like this one: in the beginning, the client is often not yet 100% certain of their needs or desired end results, so new requirements and ideas arise in the middle of project development. This means that projects built to the initial specifications often fail to completely meet the client’s needs, which can be disappointing for everyone involved.

Hoping to avoid this scenario, we (our software development team, and project and senior management) proposed implementing the project using Scrum. This allows us to flexibly respond to changes in requirements and keeps the customer closely tied to the project development process so we can avoid unpleasant surprises at the end of development. At a recent Cocomore “KnowledgeLab”, I presented a brief overview of Scrum methodology, a topic which is certainly too broad to cover, in-depth, in an hour-long presentation. So I limited the scope of my presentation to the most essential elements of the Scrum process: roles, events, and artifacts; then used Lego Scrum to try to better illustrate the model. This article provides an overview of the same basic concepts covered in our workshop session and describes how I helped immerse team members who had not previously worked with Scrum in the concepts and processes. We have been using Scrum for other “ambitious” Drupal projects and plan to provide in-depth case studies for some of them, with details about more specifics related to Drupal; this article provides a general foundation for understanding these upcoming case studies.

Scrum: a process model for agile software development

Agile software development is characterized primarily by an iterative procedure with alternating planning and development phases. The advantage this provides is that parts of the system are developed early on and can be tested before implementation of other parts. This reduces the risk that project development heads in the wrong direction. Rather, responding quickly and flexibly to changes in the requirements, the components of a system can be redefined to best meet a client’s real needs.

agile_workflow_with-url_03.png

The background of Scrum

The term “Scrum” originally comes from the sport of rugby and means “crowd”. Team-members work closely in a circular pack while their opponents try to prevent them from gaining ground. To the casual viewer, this may look merely like a disorganized shoving match, but it is based on a strict set of tactical rules and involves strategy and planning. The comparison is quite appropriate, because, as in rugby, in this form of development there is a team of players who stick together and adhere strictly to a few, well-defined rules. In general, the team plays the main role in Scrum. Unlike the classical approach to software development defined in the waterfall model, the team estimates how long it will take to implement the tasks requested by the product owner and decides which tasks can be accomplished during the timeframe of a sprint.

“Roles” in the Scrum process

Similar roles exist in Scrum. In addition to external roles such as “customer”, “manager”, and “user”, there are three primary roles involved in Scrum: the “Product Owner”, “ScrumMaster”, and “Development Team”:

  • The “Product Owner” provides the team with a vision for the product that must be developed. She is in close contact with the customer. This role defines the product’s features and prioritizes them. After each sprint, she is responsible for accepting or rejecting the functionality delivered by the Team.
  • The “Development Team” builds the product’s functionality, as requested by the Product Owner. It is responsible for compliance with an agreed set of quality standards for each component and jointly determines the required duration needed to implement each task. The Team also determines how many features it can deliver in a sprint.
  • The “ScrumMaster” assists in the implementation of the Sprint’s goals. In order to do so, the ScrumMaster does not actually participate in the development process, nor does she influence the team’s decisions. Rather, she helps eliminate problems which hinder the team’s productivity and aids in guiding the sprint to ensure that the Scrum process is followed.

Meetings & “Artifacts” in the Scrum process

Before development begins, the Scrum Team commits the Definition of Done (DoD), in short, they decide, in advance, what will determine whether a feature has been completed, to specification. The Product Owner defines the tasks necessary to achieve the desired objective. These tasks are included in the “product backlog”. Ideally, these backlog items are defined with the help of “user stories”, with requirements which are are user-oriented rather than technology-oriented. For each user story, there should be at least one “user-acceptance test”. This not only helps during the development process, but also during the sprint review for accepting delivered functionality.

Backlog items in a Drupal-based project might typically involve tasks to assess which goals will entail new content types, whether existing “contrib” modules will satisfy elements of the use case, etc. The acceptance criteria might contain what fields these content types will need, how forms have to be validated, what happens after a submission, etc. The DOD might then involve adding modules to the project repository, configuring modules and content types with a Feature or installation profile, following the Drupal Coding standards, applying tests, etc. Of course some backlog items will often require custom modules, some of which might be ideal candidates for a Product Owner to sponsor as a new contribution to the Drupal community, the benefits to the Product Owner including likelihood of community involvement leading to functional improvements over time as well as building “good will” in the Drupal community—taking from it and giving something back.

In Sprint Planning Meeting 1, the Product Owner identifies individual backlog items and explains them. The Team is encouraged to question ambiguities and thus to get an accurate idea of​what the Product Owner expects of them. Subsequently, the Team estimates how long they will need for the implementation of an item in the backlog, a step which commonly involves the technique. According to these estimates, the Product Owner re-prioritizes the backlog items and determines the goals for the first sprint.

In the following Sprint Planning Meeting 2, items are again chosen for the sprint backlog. If the individual tasks are too large, the Team attempts to break them down into smaller sub-tasks, with the aim to ensure that all tasks on the backlog can be managed in a day or less. The Sprint Backlog is used during the Sprint to document which team member has been assigned to which tasks and what the status of each task is. For this purpose, a “Scrum Wall” or “task board” is often used, with columns for sprint members to quickly see the status of each task: columns or sections are created for “To-do”, “In progress”, and “Done”, allowing tasks to easily be sorted.

A sprint is always the same length, which should be between 14 and 30 days. Every day there is a “Daily Scrum”; this is a short meeting which attendees try to keep to a maximum of 15 minutes: each team member says what they accomplished the day before and what they plan to do during the current day; problems and obstacles are addressed. If determining a solution to an obstacle will take longer than the allotted time-frame, the ScrumMaster documents this in her “Impediment Backlog”—a list of obstacles impeding the accomplishment of the sprint goals—and works to find a way to resolve them (outside of the daily scrum meeting).

Each sprint ends with a “Sprint Review”. This is a meeting in which the team presents their work. The Product Owner verifies that the tasks fulfill her requirements. The review accepts only those tasks that are truly ready; unstable or untested items migrate back into the product backlog. Work progress is recorded in a “Burndown Chart” where time is on the x-axis and the y-axis includes outstanding tasks. The Burndown Chart helps to provide an overview of progress in working through the project backlog. But, as already mentioned, the issue is relatively complex and not really suited to a brief explanation. Now for the fun part…

LEGO Scrum

As the acting Product Owner in our Scrum workshop, I established a project to build a “city”. Having dug out my old Legos from the cupboard (I hope nobody resented that they were a little dusty), I considered what I’d like to have built in my Lego town. I wanted: houses, a school, a bus stop, a Simpsons statue, and a few other things. I wrote these objectives on slips of paper and put them on our backlog “task board”. During the Team’s Planning Poker session, there was much debate about the size of each item, e.g. whether an elementary school is “bigger” than a church. The Team then considered what could be implemented in a sprint and the sprint backlog items were transferred to the backlog.

Our Scrum task board

During our mini-model of the sprint process, each sprint was set at 3 minutes and we had three sprints to complete the project. After each sprint, I was allowed to mercilessly tear down built elements which did not meet my acceptance criteria. Of course there were heated discussions at these times about whether a building was not yet ready and there was haggling about windows, doors and church crosses. But in the end, the decision to accept or reject features was left to me, as the Product Owner, so some “completed” tasks migrated back into the product backlog. And so we continued to the next sprint planning, the next sprint, and so on. In the end, only the church and primary school were left with small defects, which I accepted; the rest of the city was just as I’d desired.

The whole process was certainly fun for everyone involved and I believe it contributed to an improved understanding of the steps in the Scrum development process, too.

And here’s the result, our beautiful, colorful Lego city!

scrum-3.jpeg

scrum-4.jpeg

scrum-6.jpeg

scrum-5.jpeg

Feb 21 2012
Feb 21

Story header graphic logos associated with the Drupal 8 initiatives

I was already planning to provide an overview of what’s been going on in the various Drupal 8 initiatives even before last week, when Dries announced the timeline for Drupal 8, which includes a “feature freeze” for Drupal 8 in only a little more than nine months from now, and planned release at the DrupalCon Europe, in late August 2013.

Drupal 7’s Plateau of Productivity?

I think we reached the Plateau of Productivity for Drupal 6 sometime in late 2009, about 18 months after its release. At that point there was no advantage to developing in Drupal 5, and Drupal 7 was still a long way off. --Dries Buytaert, June 8, 2011 (about 5 months after Drupal 7’s release)While most of the top Drupal 6 modules are now available, in some state or another, for Drupal 7, and I would certainly choose Drupal 7 for a large Drupal-based project that is not expected to be deployed for some time, from the outcry of protests I think there are a lot of people who would not agree that Drupal 7 is yet at its Plateau of Productivity. I would choose development in Drupal 7 for most projects, but there is still plenty of reason for site builders to work with Drupal 6, especially if they need particular features (e.g Nodewords / Metatag functioning properly, among others) and if they need to deploy the site now, with those features ready for use. Dries indicated that he thought Drupal 6 reached its Plateau of Productivity in late 2009, about 18 months after its initial release. At that point, there were fewer than 20,000 sites using Drupal 5 and more than 200,000 sites using Drupal 6. While this order-of-magnitude-greater-usage is not likely to ever be seen comparing Drupal 7 vs Drupal 6 usage (at least not before Drupal 8 is released), I do think that it’s significant that Drupal 7 usage has finally overtaken Drupal 6. That said, I don’t think we are truly at Drupal 7’s Plateau of Productivity, the point where building a new site on Drupal 6 would be “pointless”. Both in terms of time-after-release and usage statistics, it is arguably premature to say we are quite to that point yet.

Quibbling aside, I also don’t think it matters whether we believe we have reached the Plateau of Productivity for Drupal 7, or not — and it certainly doesn’t matter whether we are all in agreement about that. I do think Drupal 7 is very “ready for use”, though and I do think we are ready to see core development for Drupal 8 get kicked into high gear and I don’t think it will significantly delay the development of certain lagging contrib modules or resolving core issues in Drupal 7 which are the final barrier, in my view, to truly reaching its Plateau of Productivity. Additionally, many of the fixes and features going into Drupal 8 are regularly being back-ported to Drupal 7, and there is increased discussion of relaxing the criteria for what can be back-ported to Drupal 7, so I see the increased attention to Drupal 8 core development as exciting: a win-win for the whole Drupal community. We now have a release date for Drupal 8, which is important for business decisions, and a better timeline to facilitate a roadmap for the final stages of determining feature inclusion.

Drupal 8 Core Initiatives

Currently there are 6 official Drupal 8 Core Initiatives which are working on various aspects of desired improvements to core. There are others likely to be added to the list as soon as a bit more progress has been made on the current list and/or as qualified individuals step up to take on some of the other “top 10” desired improvements we had on our collective community wishlist. Some of the improvements require fixes to issues plaguing Drupal 7 and 6 and have been backported. Most of the others involve dozens, if not hundreds, of related issues. Following is a brief summary of each of the current core initiatives and what their priority goals are for Drupal 8. In the interest of brevity, the explanations leave out a lot of juicy details, but for those who haven’t been paying close attention and who might like to get involved, I hope this summary is useful:

Web Services and Context Core Initiative

The Web Services and Context Core Initiative (WSCCI, pronounced “Whiskey”), formerly referred to as the “Butler” project, is a core initiative led by Larry Garfield of Palantir.net, aka “Crell” on Drupal.org. While the traditionally typical HTTP request has been for HTML pages, the modern Web has brought with it the need for HTTP services which deliver information which is not necessarily in the form of HTML. This is especially true for mobile applications, but also applies to feeds and other communications via HTTP. The goal is to “take Drupal from being a first-class Web CMS to being a first-class REST server which includes a first-class Web CMS”. Really, this initiative spans a huge range of related issues and without writing an article many times the length of this one, I could not possibly cover everything, but…

Symfony2 logoUsing Symfony2 components is a big part of this effort; Symfony2 is an open-source application framework with a lot of nicely abstracted and discrete components, several of which are being integrated into Drupal to build on its strengths as a CMS. The HttpFoundation and ClassLoader elements have already been added to Drupal 8, but the latest WSCCI Sprint, attended by almost all of the Drupal core developers most of us can probably name, along with Fabien Potencier, the Symfony lead developer, determined that several other Symfony2 components would also be included. While these changes may sound daunting to many long-time Drupal developers, it should actually make the core much more approachable for developers new to Drupal, while also making Drupal inviting to experienced Symfony developers. Additional benefits include reducing a the heavy load of Drupal requests, making it more “lean and mean” and providing partial page caching for example, while also delivering a number of powerful features for Panels-like applications, better blocks, and much, much more. Some of the work related to the WSCCI project has been underway for some time now and was encapsulated in a Drupal 7 development module called “Butler”. [Update: I had linked in the Butler project, but Larry Garfield has indicated it is “vestigial” and there is no way that any of the final WSCCI changes will be back-portable or functional as a D7 module.]

If you want to learn more about WSCCI, Daniel Kudwien (aka ‘sun’ on Drupal.org) has recently posted an excellent article which, similar to Dries’s post about the Sprint, also focuses largely on what was covered at the recent WSCCI Sprint and goes into greater technical depth about what it all means. Update: There is also a new post from Larry Garfied which also explains some of the latest developments in WSCCI. Again, this is a huge and crucial initiative for Drupal 8 to live up to the envisioned dreams, and there are ways for community members of all experience levels to dive in and contribute to its success. There is a ton to do in the months remaining.

Multilingual Initiative

Multilingual InitiativeThe Multilingual Initiative, led by Gábor Hojtsy of Acquia, covers a wide range of issues related to improving Drupal 8’s support for multilingual support (internationalization and localization issues). The issue queue is daunting, but there are a lot of experienced developers pitching in. If you’ve worked with non-English sites in Drupal or sites with more than one language, or have written and contributed a module and then realized you had to sort out how to deal with all the issues related to multilingual support, this work should be of interest. I’m not going to go into all the pain points you might be aware of in Drupal 6 and Drupal 7 or which of the improvements have been or might be backported, but we can only hope that many of them will be. Issues related to language negotiation, translation, and associated APIs are a particularly confusing area of Drupal and the more they can be improved, the better. There was a Multilingual Sprint which was just held in Budapest (with participants in other areas communicating via IRC) and a multi-day Sprint is planned to follow the Denver DrupalCon.

Since a primary reason for the existence of the Cocomore Drupal Core and other related Cocomore-maintained contrib module forks has been issues related to multilingual support, this is of particular interest to the Cocomore development staff, as it should be to anyone working with non-English or multilingual Drupal sites or who cares about making their modules and themes properly locale-aware. So jump in and help out if you can!

Mobile Initiative

Mobile InitiativeThe primary goal of the Drupal 8 Mobile Initiative, led by John Albin Wilkins of Palantir.net, is to make Drupal the leading mobile CMS. While there are naturally overlaps between the goals of the Mobile Initiative and the WSCCI (web services needed for native mobile applications) and HTML5 initiatives, there are still a wide range of goals left for the Mobile Initiative to work on, including (but not limited to):

  • Getting Drupal’s administrative forms mobile-device-ready
  • Converting Drupal 8 themes to be “responsive”
  • Performance improvements (e.g. “responsive” images)
You can read more about the strategy for the Drupal 8 Mobile Initiative and John Albin’s more detailed blog post about the initiative to get further information.

For the Mobile Initiative to be truly successful, the team will need a great deal of community support, not only from the obvious PHP and Javascript coders, but also people with design and usability knowledge and ideas, people knowledgeable about accessibility issues, HTML and CSS gurus, people to help with documentation, and testers… lots and lots of testers with every kind of mobile device.

I should mention, for readers who are new to Drupal, that mobile support is not something new to Drupal 8; you don’t need to wait for it since there are already ways to produce mobile content in Drupal 6 and Drupal 7. But the mobile initiative will hopefully take a lot of the current pain out of working with all the inter-related modules, themes and other technologies required to have anything approaching an ideal solution to mobile issues in current versions of Drupal. You should still do a search to find the right solution for your use case, but some of the popular mobile-related modules include: Mobile Tools, the Mobile Theme module, Browscap, SMS Framework, WURFL, and Mobile Codes, Phonegap, among other common modules which are not specifically for mobile development, but can be helpful. And DrupalGap is another promising module which is still in the developer’s “sandbox” at this time. There are a number of themes which are well suited to Drupal development, including the Mobile theme, which can be used as-is or as a basis for a custom mobile theme, AdaptiveTheme (as well as all of the themes based on it, such as Pixture Reloaded, Sky, and Corolla), and Boilerplate. You’ll find numerous blog articles, recorded DrupalCon sessions, and resources. There is also a new book which is expected soon and which you can already pre-order and start reading (RAW): Drupal 7 Mobile Web Development Beginner’s Guide.

HTML5 Initiative

Drupal html5 logoThe HTML5 Initiative, headed by Jacine Luisi, is another of the major initiatives for Drupal 8, which (as mentioned, above) has strong ties to the success of the Mobile Initiative, as well. You probably saw the announcement a few months back that Drupal 8 already has HTML5 as its default “doctype”, but that was just the first step toward getting Drupal 8 fully HTML5-ready. Templates, theme functions, markup… everything needs to be ready and there are still plenty of open issues related to HTML5 in Drupal 8 if you’d like to join the effort.

The HTML5 Initiative also has close connection to the web services and mobile initiatives, of course, so getting this all working is a vital part of the effort.

Configuration Management Initiative

The Configuration Management Initiative (CMI), led by Greg Dunlap (aka heyrocker on drupal.org), aims to sort out the issues related to maintaining, storing, and deploying configuration of a Drupal site. Currently, all the configuration for a Drupal site (except, of course, for the basic database access settings stored in settings.php) is stored in the database, and deploying it is a pain. Furthermore, if someone changes settings and it breaks site functionality, there is no simple way to “roll back” just those changes. The CMI moves all configuration from database to disk in a standard format which can be more easily deployed, can be stored in a version control system, and can be used in multiple sites more easily. This provides a much better development workflow to easily take configuration used on one site to another, and to modify it, as needed. Of course it should provide for much more useful distributions and installation profiles.

You can read more technical details about the CMI, at least as it was initially conceptualized, in Webchick’s summary of the first CMI Sprint held in June 2011 and there is ongoing discussion of the initiative in this Drupal Groups thread. Needless to say, this should be a big improvement over what’s currently possible to do with Drupal’s Features module, but if you need to package configurations to use them on multiple sites, the Features module is currently your best friend.

Design Initiative and Usability/UX

Design Initiative PseudologoLast, but certainly not least, the Design Initiative, led by Jeff Burnz of AdaptiveThemes, aims to give Drupal a new look for Drupal 8 Of course the theme design will also be fully mobile-ready. Part of the effort involved designers collaborating about the new look before the coding phase for the theme was begun. According to the official timeline set out by the initiative team, we are now in the middle of the development phase. If you are a theming expert and want to help, contact the initiative team and see what you can do. Currently all work is in the initiative development sandbox, so you won’s see it committed to the “current” (Git) version of Drupal 8 until it’s pretty well done.

I know, I know... my graphic for this section has more to do with UX than “Design”, per se, although they are closely related. Good designs should be user-friendly. Anyway, strictly speaking, Usability is a completely different initiative which is not currently on the “hot-plate”, at least not for Drupal 8. Why? I guess there is always time to improve the UX of a product as long as it does not break (too much) and does more good than harm, so improvement to UX can continue even after product release. And of course we still have 18 months before Drupal 8’s release, so getting the core features right, first, is of most importance. If you are interested in Usability issues, however, there are regular meetings held in IRC. You can connect with the Drupal Usability group here. You might be particularly interested in the discussion of the recent Drupal 7 Usability Study at Google. The videos videos from usability study are particularly useful for identifying current “sticky points” in Drupal 7’s usability. Presumably all of these usability issues will be fixed in Drupal 8 and hopefully most can be backported to Drupal 7 without causing more harm than good.

The “Current” State of Drupal 8 Core Initiatives is in the initiative sandboxes

As a point of reminder, don’t expect to see much of the progress in Drupal 8 if you check out the project from Git. Not a lot has been pushed to the central repository and is, instead, on individual developers’ repositories and/or in shared initiative “sandbox” repositories. By keeping experimental code out of the “master” repository, the hope is to keep the issue count down and prevent issues caused by incomplete code in one area of the product from wreaking havoc (or masking issues) in other parts. This is the benefit of a distributed VCS like Git, but it also means that in order to test the latest, most experimental features, you will need to work with the sandbox versions.

So many initiatives, so little time!

If you are like me, you are now inspired but you might be having trouble picking where to best apply your talents. Check out the issue queues for each initiative if that’s the case. You might find something you can take on and help lay a few stones in the foundation of what’s sure to be the most awesome version of Drupal yet!

Oct 20 2011
Oct 20

As part of the Knowledge Lab at Cocomore on 2 September, 2011, I outlined how to use Jenkins to implement Continuous Integration for a Drupal-based project. The basic building blocks for the demonstration included Jenkins, a demo Drupal project, and its automatic update from the SVN version control system, which triggers each run of SimpleTest. I will describe the primary steps to this process here.

Basic Installation

There are fully prepared Jenkins packages available for download for the most popular Linux distributions, including the Debian server version I used. The Jenkins project even maintains a repository which blends seamlessly into the software management. All the necessary commands are described on the Jenkins download page; with them, installing the base system is simply an “apt-get install jenkins” away.

Of course, since we want to test a Drupal system, our machine also needs a Web server (Apache), PHP, and a database (MySQL). Installing Ant is also useful, since it provides a good way to automate tasks and is very well supported by Jenkins.

Configuration

The next step is to create a new Job in Jenkins for testing our project. The “Build a free-style software project” option is the recommended setting for an Ant-based project like this.

Create a new job in Jenkins

On the configuration page, there are numerous settings to customize the job, according to your needs. For example, you can configure which version control system to use. CVS and SVN support are included in the Jenkins default installation, but there are easily-installed Jenkins plugins available for numerous other systems such as Git, Mercurial, or Bazaar. In this example, we are using SVN.

We need to add the repository URL (including path) to allow Jenkins to find our source code. We also need to configure what should trigger a build. For easy setup, it makes sense to either start the build at fixed intervals, or have Jenkins make periodic checks for changes in the repository and begin build execution after changes. We’ll choose the latter option and, for this example, the code in the “Schedule” field is set to check the repository every two minutes. It’s also useful that Jenkins examines not only the version of the “direct” project code, but also any linked dependencies via svn:externals.

Configure SVN in Jenkins

Now that Jenkins can find the source code, we need to configure what should happen during a build. We have chosen to create an Ant-based target, so we create a series of steps for our build, as Ant targets, which are executed in sequence.

Build processes in Selenium configured with Ant targets

We have yet to define what to do with the results of the build. We want to configure SimpleTest to write its output in JUnit XML format, so we select the JUnit plugin and enter the location our SimpleTest output will be found.

Post-build actions in Jenkins.

Here’s the relevant excerpt of the Ant target which runs the SimpleTests. In this example, it runs all tests in the group, “Demo”:

   target name="run_simpletests">
  [...]
   <exec dir="${basedir}/htdocs"
    executable="php"
    failonerror="true">
    arg line="scripts/run-tests.sh --php /usr/bin/php --url http://demo.debiserv/
      $--xml {basedir}/build/logs/simpletest Demo"/>
   </exec>
  </target>

The example below shows a very simple “Dummy” SimpleTest, which can be switched back and forth between returning “test successful” and “test failed”.

<?php
    
class DemoModuleTestCase extends DrupalWebTestCase {      public static function getInfo() {
       return array(
      
'name' => 'Demo Module tests',
      
'description' => 'Test the demo module.',
      
'group' => 'Demo',
        );
      }
   
      public function
testDummyTest() {
      
$value = true;
      
//$value = false;
      
$this->assertTrue($value, 'The value is true.');
      }
     }
?>

Jenkins build historyHere, if we look at the “Build History” block, we can see the results summary for recent test commits. The first was set to trigger a SimpleTest failure. Jenkins recognized a change in SVN, which triggered running build #34. The yellow ball indicates a build which completed, but a test failed. A subsequent commit to SVN triggered build #35; the blue ball indicates that the build and test were successful.

You can easily configure Jenkins to send notifications, via RSS or email, whenever the status of a project changes, so your development team is immediately made aware whenever any code changes cause a test to fail.

Conclusion: Continuous integration with Jenkins is useful

In conclusion, continuous integration can be implemented with Jenkins for a Drupal project. It is useful to formulate the steps as Ant targets; these targets can also be used for setting up development environments, so the time taken to write the automation is spent once, with continuous dividends throughout the life of your project. Drupal’s built-in SimpleTest framework can be a step in the project build process and further integrate its output with JUnit-compatible post-processing plug-ins. Jenkins notification features help keep developers up-to-date on the status of the project. With a little configuration, this can produce a complete solution.

PS: This basic demonstration of Jenkins did not cover the issues of security and authentication. As you’d expect, Jenkins supports users and access rights. On real installations such configuration should be considered mandatory, even if the system is in your internal network.

Aug 29 2011
Aug 29

Sometimes, when troubleshooting a Drupal issue on a site, it's best to determine how much time you are willing to spend on fully solving an issue and be willing to accept a reasonable compromise. We encountered such a situation recently with a rather odd issue: If an authenticated user attempted to post a comment on any of the German blog posts here, they were unable to complete the operation since the "save" button was missing ("preview before save" was required) and for some odd reason, "preview" was not working for admin or other authenticated user roles. If logged out, there was no problem. Actually, it took a while to determine it was the preview, itself, that's not working. We also determined that this may be a bit obscure and could take time to troubleshoot and be better put on the "back burner" for now.

If you want to post a comment, please log out and then try again...

Preview of comments on German blog posts only works for anonymous user

The issue was that we had comment settings on blog post configured to "preview required". It worked fine on English posts, but on German posts, the "preview" would never appear, so neither would the "Speichern" ("Save") button ever be available. Oddly, this issue was only seen on German posts, and also only seemed to affect authenticated users. If a user was not logged in (was seen as an "anonymous user"), they would get the preview and then be able to save their comment.

The simple interim solution: Make 'Preview Comment' Optional...

Simple solution - Make preview optional instead of required.

Preview was set to 'Required' in the Comment settings for the content type, "Blog Entry". Since it wasn't immediately apparent what was interfering with the preview functionality for authenticated users posting comments on the German blog posts, when the issue came to my attention, I immediately set this configuration to "Optional", which meant that while the "Preview" button still doesn't work for authenticated users posting comments on German blog posts, they can at least save their comment without logging out and making their comment as "anonymous". This was a workable interim solution which I had time to implement.

Troubleshooting... trying different things to determine a pattern...

During troubleshooting of this issue, I noticed that an older "localhost" (development) installation of the site worked as expected, even though it also included the language switching by domain and almost entirely the same configuration. What was different? Well, my older localhost was not up-to-date and had a slightly outdated version of the Cocomore Drupal Core. It also had a new version of Captcha (there is a hidden Captcha on the comment form). I wondered, first, whether the Captcha module could be involved, so I turned off Captcha for the comment form and found the problem persisted. Admin and other authenticated users still could not get a 'preview' of a comment posted on a German blog post.

After restoring Captcha for the comment form, I decided to check whether authenticated users (with rights to create a blog entry) could preview a German blog entry node. I determined that preview worked, on both the localhost and production sites when creating German or English blog entry content. So the issue really is limited to comments. I also tried changing the input format for the comment (as "admin" I could select "full HTML" instead of our "blog HTML" input format). But the admin user could still not see a preview.

Wondering whether this affected other content types, I tried responding to a forum post in the German section, where "preview required" also seems to be set. The preview worked as normal. So far, this issue only seems to affect previews of comments on blog entries.

There are more things I could do to troubleshoot an issue like this, but it takes time and simply not having a functional preview of comments, while not ideal, is also not worth wasting a lot of time on, if none of the "obvious" troubleshooting steps yields more useful information. For now we will just have no "preview" of comments added to German blog posts, at least for authenticated users. This is ameliorated by the fact that the authenticated users can edit their comments, so can use "save" (and then "edit") in place of preview if they notice any real need to fix something.

Has anyone else seen something like this?

Any ideas? If you have experienced a similar issue and you did happen to track down the cause, please comment here. In the meantime, I'll simply be paying attention this issue and see if it clears up "on its own" (e.g. after another core update or something) and/or keep my eyes open for possible causes or solutions. You can't always justify spending a lot of time getting one small feature of a site "perfect", especially if the "client" is yourself, but these things can be puzzling till the cause is identified.

In any case, I trust I'll know what's going on before too long, but won't give high priority to solving this issue, at least not for now. Sometimes it's best to just keep such issues in the list of "things which need an explanation". There are plenty of other things which are higher on my current "to do" list. At some point, I'll have other reasons to get my development version of this site back in complete sync with the production server and maybe, then, I'll be able to replicate this problem on my local machine, and do things to troubleshoot it that I'd rather not do a on production server. Until then, this is a just a bizarre quirk of our production environment. I'll post an update when the mystery is solved.

Feb 22 2010
Feb 22

Play Video

Movie link (right-click to download) Problem with this video? Contact me

Flash and its associated players are all the rage (actually have been for quite some time), except for with the iPad that is. Obviously, you can embed video into your Drupal site in a number of ways.

You can use an external site like YouTube or Blip.tv using the Embedded Media Field Module or you can implement video on your own site using the FLV Media Player Module in conjunction with JW Player.

I've already covered how you can use any of the possible flash players (JW Player or Flowplayer) in this video about SWFTools. So, what was next was Flowplayer and it's here that I've put together a video about using the Flowplayer API Module in conjunction with the respective, and required, Flowplayer flash player and javascript.

Now, you don't have to worry about downloading the Flowplayer Javascript and flash file, those are all included with the Flowplayer API Module. What isn't covered, that I show in the video, is some of the extended coolness you get with things like Flowplayer playlists.

However, if you're seeking to do REALLY cool things with video then Flowplayer API is definitely the way to go. It's going to provide the greatest level of customization (that's customization that YOU'LL have to do), with the lowest amount of overhead, of the other modules I've worked with. You'll have to get into the PHP of your theme to implement, but once you start to learn it, you'll really start to think about radical things like Views based videos series driving Flowplayer to create dynamic playlists and other cool whiz-bang features.

UPDATE: In the video, I mention that Flowplayer is becoming the most popular open source flash player. This is debatable. I should have said it's "my" favorite player. Here are some trends and insights regarding the two most popular players.

Jan 29 2010
Jan 29

I generally would style individual page elements like menus, blocks, views, and other content by using their own class names or IDs. That would mean if I wanted a consistent style to be applied to many of these elements I would have to override template files just to add a consistent class attribute, or have multi-line selectors in my css which would make it incredibly difficult to organize. Then one day I got smart and started to use Panels. Without getting into much detail, I’d have to say that using Panels to create my own custom layouts and plugins has changed my game as a Drupal themer.

But I’m already a proficient Drupal themer, I don’t need panels to do my layouts...

Perhaps, but you reap huge benefits from developing and designing Panel layouts and style plugins instead of block and page template files. For example:

  • An intuitive administration page - The block administration page has a single column to represent your layout; not exactly user-friendly.
  • Reusable style plugins for both panes and entire regions - sure you can use classes to style your blocks, but that requires extra work in your code when you need to change skins quickly.. Not to mention you can accidentally break things.
  • Apply the same piece of content in multiple regions - You can’t do this out of the box with Drupal, however, the Multiblock module helps with that, but I found that to be a little extra maintenance on my part.
  • Creating Panel layouts are actually easy - Just as much as page.tpl.php, but you get more bang for your buck.
  • More control over visibility settings - Panels goes way beyond Drupal’s simple “show all, or show none” approach (see block visibility). Panels has built-in context rules, as well as hooks to define your own contexts.
  • More control over caching - Again, Panels provides hooks to create your own caching plugins. Might not be used too often, but it’s there when you need it.
  • The list literally goes on and on and on...

So are you sold yet?

Overview of the Panels API for Style Plugins

Developing a Panels style plugin isn’t particularly complicated, but does require you to have familiarity with some of the tools available. Here are the essentials:

HOOK_STYLENAME_panels_styles()

This returns an array of the following keys:

  • title - displays the name of your style to the UI
  • description - displays a description above your settings form (if applicable)
  • render pane - callback to render a pane (implemented as theme_YOURCALLBACK)
  • render panel - callback to render a panel region (implemented as theme_YOURCALLBACK)
  • settings form - callback to function that returns a form definition
  • settings validation - same as FAPI form_validate
  • hook theme - same details as hook_theme

theme_style_render_pane( $content, $pane, $display )

This is your render pane callback (the “style_render_pane” text can be whatever you want, so long it matches the value of “render pane” key in HOOK_STYLENAME_panels_styles)

  • $content object - contains information about what type of content that particular pane is displaying (node, menu, block, custom, etc.) title, content, so on...
  • $pane object - contains all the properties you can think of for a pane: pane id, panel display id, which region it’s rendered in, the style plugin attached to it, user configured css ID and classes, position in region, even data about the content that it contains ($content).
  • $display panels_display object - contains a HEAP of data about the panel itself: arguments passed to it, it’s regions, it’s layout style, cache settings, and even the data about each the panes that it contains ($pane).

theme_style_render_panel( $display, $panel_id, $panes, $settings )

This is your render panel callback (“style_render_pane” can be called whatever you like, so long it matches the value of “render panel” key in HOOK_STYLENAME_panels_styles)

  • $display panels_display object - same as above
  • $panel_id int - self explanatory..
  • $panes array - an array of all pane objects that are rendered on the display
  • $settings array - The results of the settings form for each panel

Creating a demo plugin


click here to download the demo and test out on your own site.

In a future post I’d like to show exactly how I’m using Panel style plugins to demonstrate some powerful tools you can create in your theme, but for now I’ll do something really simple to help get people familiar with what you can do.
I generally like to put panel layouts and plugins in my theme opposed to in a module. So first thing we’ll do is tell Panels that we have a custom plugin in our theme. In this case, our theme name is called ‘mytheme’, so we’ll add this line to our mytheme.info file:
(you can drop this into your already existing theme, just replace ‘mytheme’ with whatever you theme is called.)

mytheme.info

  1. plugins[panels][styles] = plugins/styles


Now we will create a folder named demo with a file named demo.inc in the plugins/styles directory in our theme. Optionally you can create the file without putting it in a folder, I just do it to help me organize any additional files I may include with my plugin.

Let’s create our initial hook to set up the plugin, we’ll be referencing HOOK_STYLENAME_panels_styles() :

demo.inc

  1. <?php

  2. /**

  3. * Implementation of hook_panels_styles().

  4. */

  5. function mytheme_demo_panels_styles() {

  6. return array(

  7. 'demo' => array(

  8. 'title' => t('Demo'),

  9. 'description' => t('my custom Panel style plugin'),

  10. 'render panel' => 'demo_style_panel',

  11. 'render pane' => 'demo_style_pane',

  12. 'settings form' => 'demo_form',

  13. 'hook theme' => array(

  14. 'demo' => array(

  15. 'template' => 'demo_template',

  16. 'path' => drupal_get_path('theme', 'mytheme') .'/plugins/styles/demo',

  17. 'arguments' => array(

  18. 'content' => NULL,

  19. ),

  20. ),

  21. ),

  22. ),

  23. );

  24. }

So in our hook implementation we are stating we created theme_demo_style_panel for the the panel render, theme_demo_style_pane for the pane render, a function named demo_form that will return our settings form definition, and we are registering a template to the theme registry in which we can call theme(‘demo’, $content) that will render markup using demo_template.tpl.php.

Flush your cache and go create a panel and add some content in panes. Click on the cog (either on the top left if it’s a region, or the top right if it’s a pane) and choose a new “Style”. At this point you should be able to see your plugin listed, Woo-hoo! However, you’ll get an error if you try using it... First, we have to create our style callbacks!

demo.inc

  1. function theme_demo_style_panel($display, $panel_id, $panes, $settings){

  2. $content = new stdClass;

  3. $content->settings = array();

  4. $content->settings['position'] = $settings['flare_position'] ? $settings['flare_position'] : 'left-top';

  5. foreach($panes as $pane_id => $data) {

  6. $content->content .= panels_render_pane($data, $display->content[$pane_id], $display);

  7. }

  8. return theme('demo', $content);

  9. }

All we’re doing here is using an object to collect all the output of the panes this panel region contains. We are doing this in a foreach loop using the panels_render_pane() function. It is important that we do this, otherwise our panel will be missing content. There’s also a mention of a settings array, ignore that for now, we’ll use it later when we implement a settings form. Now you can use your region style without errors, however, there isn’t anything exciting about returning the raw content.. Let’s move into actually using a template. Create a file named demo_template.tpl.php in your demo folder.

demo_template.tpl.php

  1. <?php drupal_add_css(drupal_get_path('theme','mytheme') .'/plugins/styles/demo/demo.css', 'theme'); ?>

  2. &lt;div class="demo"&gt;

  3. &lt;div class="demo-inner"&gt;

  4. &lt;div class="demo-inner-deep"&gt;

  5. <?php print $content->content; ?>

  6. <?php if ($content->settings['position']): ?>

  7. &lt;div class="flare flare-<?php print $content->settings['position']; ?>"&gt;&lt;/div&gt;

  8. <?php endif; ?>

  9. &lt;/div&gt;

  10. &lt;/div&gt;

  11. &lt;/div&gt;

Here I’m using drupal_add_css() to retrieve the css file we need to style our template. This is all pretty typical stuff if you’re familiar with template files. Oh, one more thing, create a file named demo.css. Here’s what that looks like:

demo.css

  1. .demo,

  2. .demo-inner,

  3. .demo-inner-deep{

  4. background:url(demo.png) no-repeat;

  5. }

  6. .demo{

  7. position:relative;

  8. width:373px;

  9. background-position:0 0;

  10. padding-top:25px;

  11. color:#fff;

  12. font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;

  13. font-size:1.2em;

  14. margin:12px;

  15. }

  16. .demo-inner{

  17. background-position: right bottom;

  18. padding-bottom:25px;

  19. }

  20. .demo-inner-deep{

  21. background-position:-373px 0;

  22. background-repeat:repeat-y;

  23. padding:15px 35px;

  24. }

  25. .demo .flare{

  26. background:url(flare.png) no-repeat;

  27. width:50px;

  28. height:62px;

  29. position:absolute;

  30. }

  31. .demo .flare-left-top{

  32. top:-10px;

  33. left:0;

  34. }

  35. .demo .flare-right-top{

  36. top:-10px;

  37. right:0;

  38. }

  39. .demo .flare-left-bottom{

  40. bottom:-10px;

  41. left:0;

  42. }

  43. .demo .flare-right-bottom{

  44. bottom:-10px;

  45. right:0;

  46. }

  47. /************ Demo Pane Styles *****************/

  48. .demo-pane{

  49. font-family: "Zapfino", "westminster", "webdings";

  50. color:#bada55;

  51. line-height:40px;

  52. }

At this point you can apply the style to the Panel (not the pane, we’ll do that next), test the page and see what it looks like. If you’re getting errors make sure you clear your cache. If you errors indicate it cannot find your template, you can explicitly assign a ‘path’ in your theme hook:
 'path' => drupal_get_path('theme', 'mytheme') .'/plugins/styles/demo'

Okay, so let me explain what the settings array is going to do. I want to include an image on the corner of my container to give it a little flare. However, I’d like to be able to configure which corner I want to use each time I use this style. So next we will implement a settings form that we can configure in case we decide that we can’t commit to a particular corner.

demo.inc

  1. function demo_form($style_settings){

  2. $form = array();

  3. $form['flare_position'] = array(

  4. '#type' => 'radios',

  5. '#title' => 'Choose the position of your flare.',

  6. '#default_value' => (isset($style_settings['flare_position'])) ? $style_settings['flare_position'] : 'left-top',

  7. '#options' => array(

  8. 'left-top' => t('Top Left'),

  9. 'right-top' => t('Top Right'),

  10. 'left-bottom' => t('Bottom Left'),

  11. 'right-bottom' => t('Bottom Right'),

  12. ),

  13. );

  14. return $form;

  15. }

Pretty standard Form API stuff. But here is the fun part: You can go back to the panel configuration page and choose “style settings” from the panel cog. Once a user submits this form, we will have access to all of their configurations in the panel style callback using the $settings parameter! That explains the $content->settings array in the panel style callback.

The last thing we want to play with is creating our pane callback. Just for the sake of demonstration we’re going to do this one really, really simple.

demo.inc

  1. function theme_demo_style_pane($content, $pane, $display){

  2. $output = '';

  3. $output .= '<div class="demo-pane">';

  4. $output .= $content->content;

  5. $output .= '</div>';

  6. return $output;

  7. }

Go ahead and configure the pane with this style in the admin page. All this is doing is wrapping a class around the pane content for styling purposes. Of course, you can almost do everything a panel callback is capable of (with the exception of including a settings form, as far as I can tell.)

So there you have it. A typical style plugin in which you can build from. I’d like to note here that I read the plugins code that come with the Panels module as my documentation, so I want to give thanks to the author, Earl Miles, for having that in there.

In my next post on Panels I’d like to talk about the data structure of the objects that are being passed into the style callbacks and map out the important data you can mine out for your templates.

PreviewAttachmentSize 11.57 KB
Jan 23 2010
Jan 23

If you use jQuery in development, you've almost definitely used $(document).ready(). $(document).ready() is a wonderful function that lets you run Javascript code as the page is ready to handle it. But one potentially frustrating aspect of it is that functions are executed in the same order they're passed in, and jQuery doesn't let you choose which functions run first.

Usually, this is fine, but every once in a while, you really want your function to run before another function. For example, if your page is running jCarousel or Google Maps, or any other library that changes the markup of your page, you might want to do some processing before they get a chance. With the traditional $(document).ready(), you'd be out of luck. However, a quick look at the $(document).ready() internals shows a way to get what we want.

ready: function(fn) {
  // Attach the listeners
  bindReady();
 
  // If the DOM is already ready
  if ( jQuery.isReady )
    // Execute the function immediately
    fn.call( document, jQuery );
 
  // Otherwise, remember the function for later
  else
    // Add the function to the wait list
    jQuery.readyList.push( fn );
 
  return this;
},

It's not really important to understand everything that's going on here, so don't worry about the Javascript. First, the function tells the browser to alert jQuery when it's done loading. Next, it checks if the browser is already ready, to see if you're running a function long after the page has already loaded. If the page is ready, jQuery will just run the function immediately. But if the page hasn't finished loading (the usual case for $(document).ready() logic), your function gets put on the end of a jQuery.readyList array. This is what we're after.

Before the page is finished loading, all of the functions added through $(document).ready() are put on the jQuery.readyList variable. If you want to change the order in which these functions are executed, all you have to do is alter this array.

Here's what it would look like to put your function at the front of the line for execution:

// Adding a function to $(document).ready() the regular way
$(document).ready(function() {
  // processing happens here
});
 
// Adding a function to the front of the list
$.readyList.unshift(function() {
  // processing here
});

Of course, this shouldn't be overused. Other jQuery authors expect functions to run in the order they're added, so they might be thrown off if the readyList is modified too much. Still, a small change like this can save a lot of headache in the right situation.

Notes:
Array manipulation is a bit beyond the scope of this post, but w3schools has a good reference on that here: JavaScript Array Object - w3schools.com

This should work in jQuery 1.3.x and 1.2.x, but will not work in 1.4. The readyList variable in 1.4 is no longer attached to the jQuery object, so it's no longer accessible to outside code.

Jan 11 2010
Jan 11

Devel is a supremely useful module for Drupal development, but if you've never enabled the Development menu block, there are some useful links you might be missing out on. Here are some features of Devel that you might not know about:

Execute PHP
Path: devel/php
Provides a text area for entering PHP code into. Any output (print, print_r, var_dump) is shown in a drupal_set_message.

PHP Info
Path: devel/phpinfo
Get PHP configuration info from the server your site is running on.

View Theme Registry
Path: devel/theme/registry
Get down deep with the theme info your Drupal site knows about. Great for expert themers.

Function Reference
Path: devel/reference
Lists every function available to your Drupal site without loading any include files. Each function links to the API reference site you can specify at admin/settings/devel, so if it's a core function or a well-documented contrib funciton, it'll link to its documentation.

Reinstall Modules
Path: devel/reinstall
Uninstall and reinstall modules. This saves a lot of time compared to disabling the module, uninstalling it, and then re-enabling it.

Theme Developer Toggle
Path: devel/devel_themer
Another time saver. I love the Theme Developer module, but it's such a hassle to turn it on, use it for minute, and then off again right after using it. This path is a callback that switches the module on and off. Very handy.

View Source Code
Path: devel/source?file=sites/default/settings.php
View the actual, raw PHP source of any file on your website. If this sounds like a security issue to you, remember that every one of these Devel paths requires permission to view it.

Edit Stored Variables
Path: devel/variable
Edit variables stored in the {variable} table. These are the same variables available through variable_get() and variable_set().

Available Form Elements
Path: devel/elements
If you've worked with Form API, you've seen #type declarations like 'textfield', 'textarea', 'fieldset' and so on. This page lists all the types available to you. This can be handy with modules like gmap that silently add really cool form elements for you.

Jul 02 2009
Jul 02

Play Video

Movie link (right-click to download) Problem with this video? Contact me

When it comes to search, Drupal seems to do OK by itself. However, there are a number of supporting modules which will make your Drupal's default search even better. These include Porter-Stemmer (english only), Search 404, Search by Page, Similar By Terms and many others.

If you're seekign to help an advanced user out, then modules like Search config can help with that. But what about the user who won't dare go into the hidden area of 'Advanced Search'? This is where the power is - right?

It sure is. This is where you tell Drupal what content types and categories you want to limit the search to. This is where a user, simply looking for a job on your site, which lists information about jobs, news, blogs and other items, can focus their results.

So, why don't you stop expecting the user to figure this out, and just make it happen for them! That's what this video is all about. Using the default Drupal search box and forcing it to focus on specific content types or categories. You control what Drupal searches for and you control where it shows up!

Search Related Modules

The Apache Solr project is what is used on Drupal.org. You know, where you get the cool faceted results from a search request.

Of course, if you haven't heard about it already, the Acquia Search service make it quite easy to take advantage of the Apache Solr coolness.

Here's the code.

<?php
// All of the following code goes within template.php

/*
* Using one of the preprocess hooks in template.php, you create a
* variable which calls drupal_get_form on the function which creates
* the search form
*/

function THEME-NAME-HERE_preprocess_node(&$vars, $hook) {
 
$vars['focused_search'] = drupal_get_form('THEME-NAME-HERE_focused_search_form');
}
/*
* This function will create a search form which adds a validation
* handler which you use to append any custom search criteria
* Note to self: Context module could be used here?
*/
function THEME-NAME-HERE_focused_search_form(&$form_state, $keys = '') {
 
// Render the form to search a focused content type
 
if( module_exists('search')) {
   
$form = search_form($form_state, '/'. drupal_get_path_alias($_GET['q'])); // Use existing search form code
   
$form['#validate'] = array('search_form_validate', 'THEME-NAME-HERE_focused_search_validate');
   
$form['#submit'] = array('search_form_submit');
    return
$form;
  }
}
/*
* The validation handler added within the search form is where you make
* any adjustments to the search handled by Drupal. You can use any
* critera you wish, including the path or other variables available
* within Drupal.
*/
function THEME-NAME-HERE_focused_search_validate($form, &$form_state) {
 
// Using an array to determine which content type to search based on path from search form
 
$content_type = array_search($form['#action'], array(
                 
'vendor_item' => '/vendors',
                 
'job_item'    => '/jobs/sites',
                    )
                  );
 
$content_type = empty($content_type) ? '' : $content_type;
 
// Initialize using any existing basic search keywords.
  // taken from node.module node_search_validate() function
 
$keys = $form_state['values']['processed_keys'];
 
$keys = search_query_insert($keys, 'type', $content_type); // additional seach criteria added here
 
form_set_value($form['basic']['inline']['processed_keys'], trim($keys), $form_state);
}
?>
Apr 01 2009
Apr 01

Developers are all familiar with the default behavior of the drupal menu systems "local tasks" (aka tabs). These appear throughout most Drupal sites, primarily in the administration area, but also on other pages like the user profile.

Generally, developers are pretty good about creating logical local tasks, meaning only those menu items which logically live under another menu item (like view, edit, revisions, workflow, etc... live under the node/% menu item).

But sometimes, these tabs either don't really make sense as tabs or you simply want to have the flexibility of working with the items as "normal menu items", or those menu items which appear under admin/build/menu.

I recently wanted to move some of the tabs on the user profile page (user/UID) into the main menu so that I could include them as blocks.

For some reason, developers think the user profile page is a great place to put tabs for user related pages such as friendslist, tracker, bookmarks, notifications and so on. But these types of items are less a part of the user's account information than they are resources for specific users. Personally, I would not think to look at my account information on a site to find stuff like favorites or buddies. I'd expect those items to be presented somewhere much more obvious like a navigation block.

Initially, this may seem like a trivial task. My first thought was to simply use hook_menu_alter() and change the 'type' value of the menu item from MENU_LOCAL_TASK to MENU_NORMAL_ITEM. However, for reasons I don't understand well enough to explain in detail, this does not work.

In order to achieve the desired result, you must change the path of the menu item and incorporate the '%user_uid_optional' argument, replacing the default '%user' argument.

All very confusing, I know. Let's look at an example.

The notifications module (which provides notification on changes to subscribed to content) uses the user profile page rather heavily. I don't want its links there, I want them in the sidebar where users can always see them.

<?php
/**
* Implementation of hook_menu_alter().
*/
function MODULENAME_menu_alter(&amp;$callbacks) {
 
// NOTIFICATIONS MODULE
 
$callbacks['notifications/%user_uid_optional'] = $callbacks['user/%user/notifications'];
 
$callbacks['notifications/%user_uid_optional']['type'] = MENU_NORMAL_ITEM;
  unset(
$callbacks['user/%user/notifications']);
  <
SNIP>
}
?>

So I have moved the notifications menu into my own menu, changed the type, used %user_uid_optional instead of %user, and unset the original menu item.

This works fine except for the fact that you'll lose all of the other menu items under user/%user/notifications! You need to account for all menu items in the hierarchy to properly reproduce the tabs in the main menu system, so we add the following:

<?php
    $callbacks
['notifications/%user_uid_optional/thread'] = $callbacks['user/%user/notifications/thread'];
    unset(
$callbacks['user/%user/notifications/thread']); $callbacks['notifications/%user_uid_optional/nodetype'] = $callbacks['user/%user/notifications/nodetype'];
    unset(
$callbacks['user/%user/notifications/nodetype']); $callbacks['notifications/%user_uid_optional/author'] = $callbacks['user/%user/notifications/author'];
    unset(
$callbacks['user/%user/notifications/author']);
?>

And of course, we don't want this code executing at all if our module is not enabled, so you'd want to wrap the whole thing in:

<?php
 
if (module_exists('notifications')) {
 
  <
SNIP>

  }

?>

Keep in mind that not all modules implement menu items using hook_menu(). It's becoming more and more common for developers to rely on the views module to generate menu items, and this is a wise choice. Menus generated using views (ala bookmark module) can be modified to get the desired result without any custom code.

Feb 16 2008
Feb 16

The importance of project management tools is almost never fully appreciated. I am shocked at how common it is for a group of developers to go working without version control, ticket tracking, development documentation and so on. The very first thing I do when working with a new client is to make sure that they get these tools in place if they haven't already.

Those who are used to working without a complete set of project management tools never fail to appreciate the benefits of them once they are introduced. I consider it next to impossible for a team to work together without managing code and tasks in an efficient and highly organized way.[img_assist|nid=155|title=|desc=|link=none|align=right|width=250|height=156]

Hopefully you do not need to be sold on this idea and are using CVS or SVN to manage your project already. You likely have some sort of ticket system. It is a little less likely that you have both of these components integrated with each other.

When it comes to choosing a solution for project management software, a die-hard Drupal user has a dilemna. On one hand, Drupal seems as though it should be the perfect solution. It's fully customizable, has lots of nifty project management related modules and, most importantly, it's Drupal! Why would you not use it? "Eating your own dogfood" is the way to go, right? Meh...

Drupal is generally considered a content management system. Personally, I like to refer to it as a website management system. It is great at managing website related stuff like users, posts, permissions, categorization, and so on. Using contrib modules, you can customize and enhance this core functionality to almost no end. But at the end of the day, Drupal is designed to handle web content and the users that are accessing it. That's what a content management system is (and if content is king, that would make Drupal... well... God).

Managing a project, on the other hand, is a much different business from managing a website. Yes, you have many shared properties such as content and users. But the essence of project management involves things that have nothing to do with website management such as a revision controlled code base edited by multiple users, a need for efficient ticket management, and ideally full integration of everything. Essentials also include stuff like a nice repository browser, user management interface for repository access, fancy reporting for tickets, organization of tasks by milestone, date, person, severity, etc...

It's a very tall order. Yes, you can do all this in Drupal, but not very well. You can piece together something that sorta kinda resembles a project management solution, but in the end, you need to invest a relatively large amount of time to create something that is less than ideal and will require ongoing tweaking and modification. Unless your business is creating an effective project management solution in Drupal (something I dream of!), you should not be using Drupal for project management.

I'm a one man shop, and I do not have time to spare. I cannot justify spending any time at all kludging together a project management solution for a client when there are already far superior solutions available at low cost. I would much rather pay someone a few bucks a month and be done with it. Let them deal with SVN administration and enhancements; let me focus on my primary task which is building cool sites with Drupal.

While there are numerous project management related service providers out there (Fogbugz, Basecamp , Beanstalk to name a few), I want to talk about my personal favorite, Unfuddle. Unfuddle has taken obvious inspiration from the folks over at 37signals, innovators of the simple, clean, effective, it-just-works web application. Unfuddle is an instant project management solution that takes minutes to set up and costs a few dollars a month. The time you'll save in not having to set up SVN and manage SVN users alone makes it worth every penny.

[img_assist|nid=156|title=|desc=|link=none|align=left|width=250|height=221]What you get with a solution such as unfuddle is a ready-to-use repository with integrated documentation, ticketing and reporting. It takes seconds to set up a new user account with permission levels fit for everyone from a developer (gimme root!) or a suit (look but don't touch).

From a single interface, you can browse code, tickets and documentation. Every component integrates with the others. You can even resolve a ticket with an SVN commit message, saving you the trouble of having to go and edit the ticket after your commit! Users can individually subscribe to whatever level of email notificaton they would like to recieve and how often. The developer can shut off all notifications while the manager can get a nice daily summary each morning of milestone completion progress, new tickets, added documentation and so on. The project manager can glance over one of the ticket reports and group tickets into milestones for reasonable short vs long term goals.

SVN comments link back to the tickets they are related to. Tickets contain links to the changesets that resolved them. Viewing these changesets, you can see a beautiful code diff and quickly see what fixed the problem. Senior team members can quickly and easily review code changes submitted by junior staff.

With tools like this available these days, it's just not worth it spending any effort whatever on a lesser solution.

Feb 16 2008
Feb 16

Would you like to learn Drupal 6 as quickly as possible? You have already learned the basics but you would like to advance further? Or you’d rather learn the new features of Drupal 6? Then this announcement is especially for you.

I am issuing my tutorial video on Drupal 6 later this year (2008) in the first half of 2009, whose title is Drupal Miracle: Step by Step Drupal 6 Tutorial Videos. This will include over 10 hours of video!

The Drupal Association will recieve a 20% of commission for each copy sold. As a result, these videos will not only increase the number of Drupal developers, but also provide financial support to the Drupal Association. That is a double advantage!

The target audience of the Drupal Miracle are those Drupal developers who are on beginner-intermediate level. “Intermediate” developers are those who have already acquired the basics and would like to improve their knowledge further, to build more complex sites. However, I also would like complete beginners to be able to learn from the videos. Therefore, I am definitely creating the teaching material in a way that can aid complete beginners.

I am going to work on one Drupal based website during the whole training to provide a real life example. The videos will demonstrate how you can construct a complex website with the aid of Drupal, which is for “real” usage. I am going to discuss in detail the most important modules like Views, CCK, Organic Groups, Panels and many other useful modules.

One of the main parts of the instructional material is going to be the demonstration of the above modules through real tasks and how to getting lots of modules to work together. Two other highly valuable pieces will be theming the site - taking an existing design and implementing it as a Drupal theme - and the basics of module development.

The videos can be watched online with a browser through the member area. There are several advantages of these online Flash videos:

  • You can immediately access the videos from everywhere in the world, you do not have to wait for delivery
  • There are no delivery costs
  • You get future updates of the videos free of charge (e.g. correction of faults, expansions)

Why is the teaching video the best means of education? The answer is: you can learn the given teaching material quickly and easily as you see each operation with your own eyes. If needed, you can stop, rewind and play again any of the videos whenever you would like to. If you are a visual type (as most of the people are) you cannot find a better teaching method.

Until the videos are ready, it is worth checking the blog for the emerging free of charge Drupal 6 videos. Subscribe to the RSS feed so you won't miss the videos!

You may also want to watch some of the previous videos that I've made including the SEO Course. The Drupal SEO Course is more than 1 hour video about how you can quickly and easily make your Drupal site search engine friendly, or what those faults are which cause your site to perform badly in the search engines. Sign up for our free SEO course in the right sidebar!

UPDATE (February 15th, 2009): The key module, Panels 3 for Drupal 6 is still missing. Therefore the release date of Drupal Miracle delayed. However, we plan to release the videos later this year (2009). Very sorry for the delay. We understand that we announced the videos very early, but without the modules we cannot record the videos (We hoped that the key modules will be ready earlier). Subscribe to the RSS feed so you won't miss any updates about the videos!

Dec 22 2007
chx
Dec 22

There are many useful editors and debuggers useable to churn out Drupal code. However, most popular IDEs are written in some non-native language, so they are so very resource intensive and because of that, so slow that I just can't use them. This includes Eclipse, Zend and Komodo. So, this article will not be about these. Neither I will write about the virtues of vi or emacs -- I use much simpler tools.

To begin with, I run Kubuntu Linux. Why that? Mac OS X does not recognize the WiFi in my laptop (and it's not the kind of laptop where you can just switch miniPCI cards). Next up would be maybe Windows, but I want to work instead of wrestling with an operating system that never does exactly what I wanted -- it sometimes does less, sometimes more and sometimes simply does not let me do certain things. I happen to have quite some experience with Linux on servers, so running Linux on the desktop is not that hard either. Which Linux, though? I very much like the APT package manager and out of the distros built around it, I like Ubuntu most (and I am not alone...). The choice between KDE and Gnome was easy, Linus Torvalds famous letter puts this into words better than I could. So we arrived to Kubuntu Linux. In general, the OS behaves rather well with my laptop (aside from a small issue with brightness), and all the issues that were a nightmare for years (WPA for wifi...) got really smooth and simple this year. So Kubuntu Linux is now a pleasure to use. Aside from the operating system, I only deal with source code, so I need something with which I can edit, view, control and search.

I almost always work remote, so easily accessing files remotely are very important to me. It so happens that KDE has an excellent "io slave" subsystem. It means I can open a dir like fish://[email protected]/home/user/ and it'll SSH in to [email protected] and show the dir as if it would be local. There is a webdav kioslave, too. I am using the native KDE editor, KATE. KATE has a nice syntax highlight and a rather primitive, string based autocomplete, but that's often enough -- curiously, given how Drupal uses many indirect ways to call a function, a string based autocomplete is often better than one based on actual PHP syntax. It also has a script debugger (see my blog post) which I do not use that much, my debugging needs are nicely covered with the occassional print, var_export etc. statement. Quite primitive, I know, but it works always -- by not getting accustomed to a debugger I can easily work in a terminal window over SSH with whatever editor I have access on whatever website I need to work on at the moment (I prefer nano in a terminal). Primitve tools have their own uses :)

My browser of choice is Opera, it's just faster and does not eat up resources. I might change to Firefox 3, the jury is still out there -- they claim to fix the memory leaks, we shall see. However, I already use FF as an HTTP debugger with Firebug and the Web Development Toolbar plugins.

I use bzr as the source control system for core. Again, I do not use much of its features, but as there is a big company (Canonical) behind it, the mirror (https://launchpad.net/drupal/main/) not just works rather well but I can expect it to be up for a long time -- it's now up for more than a year now. It's very easy to copy the mirror to the local machine -- and now it's very fast too, in the past it was like ten minutes, now it's about one minute to get the 8000-something revisions. The same bzr branch command lets me create as many branches as I want. I keep around a handy and simple alias (B='bzr diff --diff-options -up') which rolls my patches. If I just want to work on something quick, I do not create a separate branch, rather revert, change, roll the patch and then repeat. I only use branches when I have some patch which takes a lot of time. (This is why you sometimes see accidentally merged patches from me.)

Next up is search. The basic Unix tools are find, grep (and occassionally, cut). Another very useful tool is cscope. I keep a cscope.files in the Drupal directory listing all the .module, .inc, .php, .engine, .theme files and then cscope can quickly show me where a function is defined and where it is used.

In the miscellaneous section, the first mention goes the trusty companion of the well known SSH utility: ssh-agent, which can store you private key in memory, totally avoding typing in any passwords. Even less known is ssh-copy-id which copies your pubkey to a server in one quick step.

Another important utility is kcachegrind which tells me about slow parts of some by visualizing the output of the xdebug profiler.

Jun 27 2006
Jun 27

The contributions process for non-core Drupal themes and modules is in need of a revamp.

Currently the process is a very loose one that does not require adherence to any tagging conventions or release process. This makes it very difficult to know the status of the modules that make up a given site. I believe this probably results in many site admins out there just leaving their site as-is because the process of updating is somewhat confusing and tedious.

We want to fix this.

While there are existing 4.6, 4.7, etc... tags applied to contrib modules, they are not consistently used by module authors. Furthermore, tags are being applied inappropriately (4.7 tags applied to 4.6 code that is not actually upgraded).

Ultimately, I'd love to see version and update management built right into Drupal (in the same way it's built into most OSs and many software packages). Drupal might have a single page the admin can visit to check the status of his core Drupal installation as well as all modules and themes he is using. The process of upgrading to the latest versions could be a very simple matter of selecting desired updates and hitting a submit button.

That, however, is a long way off. We need to start by creating a process with which Drupal developers and contributors can "tag" their software releases and make those releases available quickly and easily.

To take part in defining this new release process, please visit "Versioning and release process for contributed projects" and leave a comment.

May 03 2006
May 03

One of the great features of Drupal is its ability to run any number of sites from one base installation, a feature generally referred to as multisites . Creating a new site is just a matter of creating a settings.php file and (optionally) a database to go with your new site. That's it. More importantly, there's no need to set up complicated Apache Virtual hosts, which are a wonderful feature of Apache, but can be very tricky and tedious, especially if you're setting up a large number of subsites.

No worries, there is a solution.

Create a new LogFormat

Copy the LogFormat of your choice, prepend the HTTP host field, and give it a name:

LogFormat "%{Host}i %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vcombined 

Get the script

Next, download the attached script (split-logfile) and store it somewhere like /usr/bin (don't for get to chmod 755 that baby!)

Now, tell apache to use pipe logfiles to your script rather than writing them directly to disk:

CustomLog "| /usr/bin/split-logfile" vcombined 

Restart Apache

/etc/rc.d/init.d/httpd restart

That's it.

Naturally, you may have to modify split-logfile if you don't store your logfiles in the default location.

 

 

Apr 21 2006
Apr 21

This article explains a practical implementation of a technique outlined in the article "Sharing Drupal tables between databases using MySQL5 Views".

Problem

You have multiple (multisite) Drupal sites and you would like to manage the content for all of these sites through a single interface. Depending on the nature of a given piece of content, you may want the content published on one, several or all of your subsites, but you do not want to have to create copies of the same content for each site.

Solution

Taxonomy plus MySQL5 views. (NOTE: this solution will not work with versions of MySQL prior to 5.)

Assumming you have your subsites properly set up and running, the first step is to create a special vocabulary which you will use to target content.

Go to [your site's baseurl]/admin/taxonomy/add/vocabulary and create a vocabulary. We'll call it simply "sites".

Next, go back to your taxonomy page (/admin/taxonomy) and select "edit vocabulary" for the "sites" vocabulary.

Add a name for each of the subsites you would like to manage. For our example, we'll have two subsites, "foo" and "bar", and one master site, "master".

Now add at least three pieces of test content. Target one piece of content for each of foo, bar and both.

Next, we're going to create a node view for each of our subsites that we'll use to replace the actual node table.

The SQL is as follows:

CREATE VIEW [subsite, eg. "foo"]_node AS SELECT n.* FROM node n, term_data td, term_node tn, vocabulary v WHERE v.name = '[vocabulary name, eg. "sites"]' AND td.vid = v.vid AND td.name = '[subsite vocab term, eg. "foo"]' AND td.tid = tn.tid AND n.nid = tn.nid ;

Because the terms that serve as our subsite labels may very well exist within other vocabularies, we also need to join on the vocabulary table to ensure our solution works reliabley.

Finally, we need to have our subsites use the views we have created instead of our master nodes table, which only the "master" site will have access to directly.

In your drupal's sites directory, you should have directories that correspond to each of your drupal sites (both master and subsites). Edit the settings.php file for each of your subsites, and use the db_prefix variable to point the site to your view. So sites/foo.example.com/settings.php would contain the following:

$db_prefix = array( 'node' => 'foo_', );

At this point, you'll want to disable creation of content from within each of your subsites. You can do this in the from the admin/access page. If you attempt to create content from within the subsites, you'll likely get a 'duplicate key' error.

I hope that explanation is clear. These articles are written rather hastily. If you questions or suggestions regarding this solution, please leave a comment.

Pages

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web