Entity Registration
The Entity registration module XXXX.
Table of contents
Drupal projects discussed in this chapter: Devel, Entity Registration.
Introduction
Entity Registration is for tracking registrations for anything people may sign up for.
A quick outline of how it works:
- You create a registration type, and add Drupal fields (e.g. favourite colour) to it for information you want to gather from registrants.
- On some entity that you want to allow registrations for (maybe an "event" content type), add a custom field of type "Registration".
- Create an instance of that entity, and select one of the registration types you created in the Registration field.
- Start taking registrations when viewing your entity!
There are additional settings, but that is the basic outline: just create a registration type or two, give your entity a registration field, and point it at one of your registration types. For more detailed instructions, check out the README.
Registration types are like content types, but using the registration entity instead of node.
Configuration
Install the Registration project and enable Registration and Registration Views.
- Navigate to . Create at least one registration type bundle.
- Two fields are always present: Email and Registrant. You can add additional fields.
- It is now possible to add a registration field to any entity you want to enable registrations for.
- To decide how the opportunity to register shall appear in the entity, visit for the field. The options are: Registration Link (link to the registration form — this is the default), Registration Form (embed the actual form in entity display) Registration Type (display type, but registration disabled) and Hidden.
- To configure the registration settings for the entity with a registration field, click on the tab, and then on in the "Operations" column.
Registrations are now enabled for the entity.
When a user is registered for an event, the link or the form will not appear on an entity unless the setting "Allow multiple registrations" is ticked in the entity's registration settinngs (see step #5).
Correct: SELECT registration.registration_id AS registration_id, node_registration.title AS node_registration_title, node_registration.nid AS node_registration_nid FROM {registration} registration LEFT JOIN {users} users_registration ON registration.user_uid = users_registration.uid LEFT JOIN {node} node_registration ON registration.entity_id = node_registration.nid AND registration.entity_type = 'node' WHERE ((( (users_registration.uid = '1') ))) LIMIT 10 OFFSET 0 SELECT node_registration.title AS node_registration_title, node_registration.nid AS node_registration_nid, registration.registration_id AS registration_id FROM {registration} registration LEFT JOIN {users} users_registration ON registration.user_uid = users_registration.uid LEFT JOIN {node} node_registration ON registration.entity_id = node_registration.nid AND registration.entity_type = 'node' WHERE (( (users_registration.status <> '0') )) LIMIT 10 OFFSET 0Creating dummy content
If your site already has content, you may skip this step and work with that content instead.
If you're testing this on a newly created test site, you can generate dummy content as follows:
Install the Devel project. Enable the Devel generate module. Create a test user (name it "test"). Navigate to
and generate 50 nodes of type Article. They will be randomly assigned to existing users.Using a contextual filter
[TBA]
Using a relationship
Navigate to
. Name it "Own content". Change the display format to be a HTML list of fields. Just leave everyting else set to the defaults.Click
.Add a relationship. Expand the third column ("Advanced") and next to "Relationships", click
. Locate the "Content: author" relationship and select it by ticking the box.Click
twice (i.e. use the default configuration).Locate the "Filter Criteria" area in the first colum side and click
. Locate the "User: current" relationship and select it by ticking the box."Click
.On the next screen, select "Yes" to configure the filter criterion to only show the current user.
Click
(top right) to save the view. It should look like the image below.Now, when a user visits the path /own-content
, she or he should see her/his own content.
If you enable showing the SQL (it can be toggled by navigating
to uid
of the
currently logged in user:
SELECT node.title AS node_title, node.nid AS nid, node.created AS node_created FROM {node} node LEFT JOIN {users} users_node ON node.uid = users_node.uid WHERE (( (node.status = '1') AND( (users_node.uid = 'x') ))) ORDER BY node_created DESC LIMIT 10 OFFSET 0
Final word
[TBA]
Last update: 2016-04-09 [gh].