Do not disable body text for container

jo1ene - January 28, 2009 - 18:37
Project:Daily
Version:6.x-1.1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

It would be helpful - in my implementation at least - to have the body text available to have an intro to my daily feature. It seems it would be easy enough for a user to ignore it if needed, while having the body available may help others. It seems unnecessary to me to disable this text area for the daily container content type.

#1

EvanDonovan - April 22, 2009 - 16:19
Status:active» needs review

Change the daily_node_info function in daily_container.inc to the following:

<?php
function daily_node_info() {
  return array(
"daily_container" =>
           array(
'name' => t("Daily container"),
                
'module' => 'daily',
                
'description' => t("A daily container is a node which displays daily changing content."),
                
'has_body' => TRUE,
                
'body_label' => t('Content'),
                
'min_word_count' => 0,
                ),
              );
}
?>

Then add the following lines of code to the daily_form function (in the same file):
<?php
$form
['body_filter']['body'] = array(
   
'#type' => 'textarea',
   
'#title' => $node_info['mymodule']['body_label'],
   
'#default_value' => $node->body,
   
'#weight' => 0,
   
'#rows' => 20,
  );
 
$form['body_filter']['filter'] = filter_form($node->format);
 
$form['body_filter']['#weight'] = -3;
?>

I used http://www.leveltendesign.com/blog/dustin-currie/drupal-6-node-skeleton as a guide to making these changes.

 
 

Drupal is a registered trademark of Dries Buytaert.