CCK & Views the ultimate combination – part 1

Vote for Drupal in the CNet Webware 100 Awards!Drupal is a fantastic content management system but is perhaps not the most non developer friendly however 3 simple modules can help you create compelling and powerful web site. So in this 3 part mini series lets see how easy it is to develop new content types and ways to view it. To help us lets use a fictitious company called AA Design who are about to start teaching a range of courses.

Quick note this post refers to Drupal 4.7 however several of these modules are now available for Drupal 5

Content Construction Kit

The Content Construction Kit allows you create content types through the web. A content type is a collection of fields. The intent of the CCK is to make the creation of custom node types easier

Lets use the following example we want to create a new node (page) type called courses each page will list a course on offer, for each course we will want a title, description, duration and cost.

To start with download and install the module CCK from drupal.org, install it in the usual way for more information see this post.

Once installed go to administer/content/content types and add content type this takes you to a form to set up information about the content type

The form is self explanatory but just to help here is some quick hints.

  • Label – This is the title of the type of content its the name that appears in add content section, just like page or story
  • Description – This is the description that appears next to the above label
  • Help text, this appears at the top of the data entry page for the content to help the author to understand what to put.
  • Title – This is the title or heading of a node if unsure leave blank.

For our example we are going to use the following

  • Label – Courses
  • Description – Information on courses on offer
  • Help – Please complete the following form detailing your course that you wish to offer
  • Title – title

After saving we are taken back to the same form but with a couple of additional tabs at the top so lets add some fields by selecting add fields again this form is self explanatory you select your data type and give it a name we will add the following fields note there are 2 pages to each form

  • Description – Text/text field, required, Select 4 rows second page.
  • Duration – Text/Text field, required
  • cost -Number/text field, required

once you have done this you need to set the access control to allow your authors to use the new content type administer/access control you will find the permissions under content.

If you now go to create content you will find your new content type courses.

That’s it for part 1 of this mini series the second part deals with setting up some views.

Get our Content via RSS feed using Feedburner
Other articles in the series
CCK & Views the ultimate combination – part2
CCK & Views the ultimate combination -part 3
HReview a CCK example using contemplate

Other Articles on the Venture Skills Network about Drupal
Drupal 5.0 goes Beta
5 Drupal Modules to Guarantee Drupal 5.0 Success
The Digg effect and can drupal survive it
– looking at how drupal can cope with bandwidth spikes
Want to create a site like Digg with no programming part 2

Like what you see try these articles on the Venture Skills Network
What’s the future for Google Hosted Applications – Is the future Bright?
Information mining the social way – Using del.icio.us to mine your competitors
Skype vs the World - Is Skype scalable?

Spread it: del.icio.us del.icio.us | digg digg it | reddit reddit


RSS icon This blog is moving soon, make sure you move with us by using our Feedburner RSS feed, if you have used the autodiscovery button in your browser you may need to swap feeds, simply delete the old feed and add, http://feeds.feedburner.com/VentureSkills For a more detailed explanation on feeds and recieving our content in various formats click here

Posted in drupal. Tags: . 12 Comments »

12 Responses to “CCK & Views the ultimate combination – part 1”

  1. pattern Says:

    I really like the basic, down to earth explanation.

    Waiting for the views!

  2. ventureskills Says:

    glad you like it, stay tuned for views up next…

  3. IbnKuldun Says:

    I really found this useful. I can’t believe CCK is so simple, but it just wasnt explained anywhere properly. Thanks ever so much. I mentioned this article in the CCK handbook for the benefit of future newbies like myself.

    Can’t wait for part three.

  4. Venture Skills Team Says:

    Hey great, and thanks for the comment in the handbook, I’m really pleased you like it. We are planning on doing a lot more CCK and views based tutorials.

  5. The Venture Skills Blog CCK & Views the ultimate combination - part 3 « Says:

    [...] so in part 1 we looked at how CCK (Content Construction Kit) can be used to develop new nodes, while in the [...]

  6. The Venture Skills Blog HReview a CCK example part 1 - Contemplate « Says:

    [...] 1 - Contemplate February 12th, 2007 — Venture Skills Team In our previous series about CCK and views we showed very simple ways to create new nodes and methods of display, we are going to take a more [...]

  7. The Venture Skills Blog CCK & Views the ultimate combination - part 2 « Says:

    [...] Posts CCK & Views the ultimate combination – part 1Want to create a site like Digg with no programming?CCK & Views the ultimate combination – part [...]

  8. Evan Says:

    i’m having an issue with being able to edit the information. each user profile has an edit field so they can change the the info but the fields are NOT showing up. any suggestions? they are able to enter info when registering and the information DOES show up when just viewing a profile. the editing of the info just doesn’t show up.

  9. links for 2007-11-29 « PaxoBlog Says:

    [...] CCK & Views the ultimate combination – part 1 « The Venture Skills Blog Drupal is a fantastic content management system but is perhaps not the most non developer friendly however 3 simple modules can help you create compelling and powerful web site. So in this 3 part mini series lets see how easy it is to develop new content (tags: drupal views cck integration overview) [...]

  10. Sajal Kayan » Drupal rulez Joomla sux! Says:

    [...] more in Drupal than Joomla without touching PHP. With some knowledge of PHP combined with Drupal (CCK+views) and some time you can effectively make any kind of portal [...]

  11. web dizainas Says:

    Really nice tutorial, thanks!
    its very useful for beginners like me

  12. Ratnesh Says:

    Nice tutorial – got me interested in cck+views – but now i need more help – can you help?
    here is my query: Help with Views using two related CCK nodes:

    I have created two CCK node types.
    FIRST – called ACTIVITY – contains three fields – activity name, activity details and activity resources.

    SECOND node type – called SESSIONS – contains three fields too – one of this field is common field with the ACTIVITY node – three fields are – teachers’s name (users), date of activity and activity name (this is the common field). The users choose the vlaue of the common field from “list of ACTIVITY node titles”

    what each teacher does here is schedule different activities on different dates of a month specific to their class.

    Now what i want is students to be able to see their schedule for a month. So i want to create a view which
    shows date, activity name, activity details and activity resources and all of this is filtered by the teacher’s name depending upon which teacher the student belongs to.

    Specifically i want to know how do i create a VIEW which (takes data from two nodes and shows based on a common field)
    so it should show for a specific teacher – date, activity name, activity details and activity resources.

    thanks in advance
    ratnesh

    i am just a teacher – hence do not have any php knowledge – but my guess is that it can be done in drupal with VIEWS.

    Any suggestions and guidance most appreciated.
    you can email me please your support to geniekids@gmail.com
    my website using drupal is running at http://www.geniekids.com

    ratnesh


Leave a Reply