Book Image

Drupal 7 Fields/CCK Beginner's Guide

By : Dave Poon
Book Image

Drupal 7 Fields/CCK Beginner's Guide

By: Dave Poon

Overview of this book

<p>The Field module is a new core module in Drupal 7, and is the next generation of the legendary Drupal 6 CCK (Content Construction Kit) module. The CCK was a developer's best friend, used on any Drupal project of any size. Now, the Field module builds on the strength of the CCK module, bringing new features to Drupal 7.</p> <p>The Field module allows custom data fields to be attached to Drupal entities (content nodes, users, taxonomy vocabularies, and so on) and takes care of storing, loading, editing, and rendering field data.</p> <p>In Drupal 7, you can create content types and you can add fields to any content type. You can rearrange the order in which fields are displayed and you can specify the label position and format of the field. Unlike in earlier versions, you do not need to download a separate module to add fields to a content type.</p> <p>Wouldn't you like to know more about how to use this important and interesting feature?</p> <p><i>Drupal 7 Fields/CCK Beginner's Guide</i> helps you to get started quickly and to get beyond the basics to take full advantage of the fields system. It covers the key features of Drupal 7 fields that will help you get your Drupal 7 website up and running with a step-by-step approach to building a Drupal 7 website with the new fields system.</p> <p><i>Drupal 7 Fields/CCK Beginner's Guide</i> will show you how to create custom content types and fields, add fields to comments and vocabularies, reuse the existing fields, create Boolean and list fields, set default values to fields, add term references to content types, add file fields and image fields, create custom image styles, format fields' display for different view modes, use contributed modules to enhance the fields system, configure field-level permissions using the field-level permission module, and also to theme fields using the new Drupal 7 theme system. You will also learn the ins and outs of the fields system from the database perspective.</p> <p>This hands-on guide will teach you to build Drupal websites that get the most out of the Drupal 7 Field module's powerful features.</p>
Table of Contents (18 chapters)
Drupal 7 Fields/CCK
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Time for action – setting default values


In this section, we will set a default value to the Tip owner field, which will be checked by default. Follow these steps:

  1. Click the Structure link on the administration menu at the top of the page.

  2. Click the Content type link, and then manage fields on the Cooking Tip row in the table:

  3. Locate the Tip owner field row in the table, and then click the edit link:

  4. After clicking the edit link, it will direct us to the Tip owner field administration page. When we go to the middle of the page, we will find a heading called DEFAULT VALUE, there is a checkbox with a label called My own tip, which is the On value we entered.

  5. We check this checkbox to set My own tip as the default value of the Tip owner field.

  6. Then click the Save settings button at the bottom of the page, which will redirect us back to the Manage fields administration page.

  7. In order to see the configuration we created, we can add content using the Cooking Tip content type, so we click the Add content...