Signup form using CCK

Using CCK, in particular node reference, it is possible to relate data types to each other, just as you would do in a relational database. For example, create a content type song, and a content type artist, and in song put a node reference field to artist. Because in Drupal a field may have multiple values, it is also possible to do this the other way around, eg. put in artist a node reference field (with multiple values) to song. This is against the principle of normalized relational databases (because of the fact that multiple values are not allowed), but it is more intuitive for an end user. This node reference field can show itself as a select list, or an auto completion text field. If you create a view, and specify this node reference field as a required relationship, and in song specify to use this relationship, then the data of these 2 content types would be joined automatically, so you can generate songlists grouped by artist.

So if you think about it, you can store any data in a content type (aka node type). That includes data from forms. For things like signup forms it is not really necessary to install a seperate module for this. Just create a new content type to store your signup data.

Let's create a content type called signup. Add a node reference field, and select the content type used to store the events. Later on, when someone creates a signup node, he/she will get a select list with all the events you can signup to (all node titles of for example node type "event"). For more experienced users, it is also possible to use a view instead of specifying a content type. With views it is for example possible to only select events in the future (no past events). Add more CCK fields if needed, for example first name, last name, number of people joining you etc..

This works ok, however usually you would want a direct link called "Sign up now!" (or something like that) in the event node. This link would take you to the signup form, where we would like to "prepopulate" the node reference field to the correct value: the event node where we came from.

The first step to the solution of this problem is to install the prepopulate module. With this module it is possible to specify default values for form fields on the node creation pages as arguments in the url. For example, in order to prepopulate  the title field with the text "foobar", you would add "&edit[title]=foobar" to the url. In the HTML source, search for the node reference field, and find the name attribute. If it is something like "field_signup_noderef[nid][nid]", then you need to add "&edit[field_signup_noderef][nid][nid]=xx" to the node creation url (watch the brackets). The "xx" needs to be replaced by the node id of the event node you are referring to. If all goes well, then the select list will show the node you specified on the url as default.

Next step is to generate this link automatically and put it on the event nodes. Copy "modules/node/node.tpl.php" to your theme directory. Copy the same file also to "node-event.tpl.php" (or whatever you called the content type where you store your events) in your theme directory. Edit the latter file and add the following after the content part:

     <a href="<?php global $language; print base_path() . $language->language;
        print $node->nid; ?>">Sign up now!</a>

Now, go to your theme settings and save the configuration (this will trigger something which causes the new template files to be read). Also in the performance settings, clear the cache. Add permissions to your users for creating signup nodes. Test it: create a couple of fake signups using the signup link on the event nodes. Create views for generating reports of signups. In order to export these reports to CSV files for use in spreadsheets, install the views bonus module, and enable the export module. To use this, add a feed display to your view (normally you would only use defaults, page or block), and under style choose CSV file.

decent post, stay aware of

decent post, stay aware of this fascinating work. It truly regards realize that this subject is being secured likewise on this site so cheers for setting aside time to talk about this! cctv johannesburg


Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! Austin City Lofts Austin

Leander Texas Home Builders

Hi I found your site by mistake when i was searching yahoo for this acne issue, I must say your site is really helpful I also love the design, its amazing!. I don’t have the time at the moment to fully read your site but I have bookmarked it and also add your RSS feeds. I will be back in a day or two. thanks for a great site. Leander Texas Home Builders

Its me Brayden Ben a

Its me Brayden Ben a professional and well experienced Designer.There are many designer more experienced then me , but now i am here to provide you the real design service I will design your name with real stones and give you high quality image , Unique and professional and no one will copy your design because its all Hand Made. stone name design


Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! great restaurants near me


I feel that it is quite easy to deal with the CCK modules. You have helped us to identify the different procedures clearly while signing up in the CCK. This will be effective to work with different types of datatypes and relating them with contents. directv


wow, great, I was wondering how to cure acne naturally. and found your site by google, learned a lot, now i’m a bit clear. I’ve bookmark your site and also add rss. keep us updated. facebook


I read this article. I think You put a lot of effort to create this article. I appreciate your work. facebook

alia johnn

I liked this article very much.Its very nice informative article.I really appreciate this article. Done a great job.Very good for a learner. New National Party also gives you a unique party policies and suggesstion for the country.

Innovate Thoughts

I read your Article. You gave a good information on nodal reference and with good example and a code is displayed in your article. your thoughts are Genius Thoughts and needs to be shareable.Your have new ideas on New Signups.You discussed about many problems many problems that faced on Websites Daily.genius thought.This article giving us the information about the Signups


I appreciate the author for providing the programming for Sign up link. I am looking to establish the primepapers services and required a simple program that could help in signing up of the visitors. This would do great to me and the visitors would also feel the same.

Ritz Carlton DC wedding

Your once-in-a-lifetime event deserves a photographer who’s a perfect fit. Our list of the most accomplished wedding photographers in Washington, DC makes it easy to find the right match.Ritz Carlton DC wedding


I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it. criminal case astuce


You have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site. facebook

For First Packers and Movers

For Superlative Packers and

It is even harder to make

It is even harder to make your own program. Most especially if the system itself is hard to handle. - Bobby Price