New Podcast

Posted Tuesday, July 27 at 2:29 pm

Ryan Price and Mike Anello recently talked with Jacob Redding (jredding), author of Beginning Drupal as well Treasurer and Interim General Manager of the Drupal Association.

Download Podcast 41
DrupalEasy_ep41_20100727.mp3
Syndicate content

NEWSLETTER

Stay informed on our latest news!

Syndicate content

Testimonial

The DrupalEasy workshop provided a balance between "Best Practices" for Drupal development and an elegant example of integrating content from Youtube , Flickr, etc. using the FeedAPI. The workshop provided useful insights in advanced site design and a wealth of resources to speed up development and make deployment safer.

Who are we?

DrupalEasy is the collective expertise of Ryan Price and Michael Anello, who joined forces to provide training and consulting services worldwide. Read all about them and what they can do.

What is Drupal?

Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...

Why Drupal?

More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...

Setting Default Year in CCK Field

If you use CCK often, then you've probably at least once had to implement a select box where the user can select a year value. Sometimes they're used for birthdays, magazine issues, events, or even historical reasons.

You can easily populate the "Allowed values" textarea of the field's "edit" page, but how can you quickly set the default value to the current year (and not have to worry about changing it every year)?

Luckily, its pretty easy. In the "Default value" fieldset there's a textarea where you can enter a bit of PHP code. Enter the following and you're good to go:

return array(
0 => array('value' => date('Y')),
);

Trackback URL for this post:

http://drupaleasy.com/trackback/226
No votes yet
Syndicate content