You are here

README.txt in Editable Fields 6.3

Thanks to Amitaibu for the following text, which may help some
people. This comes complete with some example code to cut'n'past into
the CCK and Views (if you have models installed to let you do that).


1. Create a content type.
Content name = Editable

2. Create a View:
Page URL = EditFields
View Type = Editable list
Fields = Title, Caption.
In the caption set Option=Editable
Filter = Only Editable content type.
3. Create some nodes from the 'Editable' content type
4. Invoke the view - the caption field can be edited.

For the lazy among us you can import the CCK and Views:
CCK (Enable "Content Copy" module):
$content[type]  = array (
  'name' => 'Editable',
  'type' => 'editable',
  'description' => 'Editable Fields demo',
  'title_label' => 'Title',
  'body_label' => '',
  'min_word_count' => '0',
  'help' => '',
  'node_options' =>
  array (
    'status' => true,
    'promote' => true,
    'sticky' => false,
    'revision' => false,
  ),
  'comment' => '2',
  'old_type' => 'editable',
  'orig_type' => '',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
);
$content[fields]  = array (
  0 =>
  array (
    'widget_type' => 'text',
    'label' => 'Caption',
    'weight' => '0',
    'rows' => '1',
    'description' => '',
    'default_value_widget' =>
    array (
      'field_caption' =>
      array (
        0 =>
        array (
          'value' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => false,
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '0',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_caption',
    'field_type' => 'text',
    'module' => 'text',
    'default_value' =>
    array (
      0 =>
      array (
        'value' => '',
      ),
    ),
  ),
);

Views:
  $view = new stdClass();
  $view->name = 'Editable_Fields';
  $view->description = 'Editable_Fields Views demo';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = '';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'editablefields_list';
  $view->url = 'editablefields';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '10';
  $view->sort = array (
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'link',
    ),
    array (
      'tablename' => 'node_data_field_caption',
      'field' => 'field_caption_value',
      'label' => '',
      'handler' => 'content_views_field_handler_group',
      'options' => 'editable',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
    array (
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => 'editable',
),
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node, node_data_field_caption);
  $views[$view->name] = $view;

File

README.txt
View source
  1. Thanks to Amitaibu for the following text, which may help some
  2. people. This comes complete with some example code to cut'n'past into
  3. the CCK and Views (if you have models installed to let you do that).
  4. 1. Create a content type.
  5. Content name = Editable
  6. 2. Create a View:
  7. Page URL = EditFields
  8. View Type = Editable list
  9. Fields = Title, Caption.
  10. In the caption set Option=Editable
  11. Filter = Only Editable content type.
  12. 3. Create some nodes from the 'Editable' content type
  13. 4. Invoke the view - the caption field can be edited.
  14. For the lazy among us you can import the CCK and Views:
  15. CCK (Enable "Content Copy" module):
  16. $content[type] = array (
  17. 'name' => 'Editable',
  18. 'type' => 'editable',
  19. 'description' => 'Editable Fields demo',
  20. 'title_label' => 'Title',
  21. 'body_label' => '',
  22. 'min_word_count' => '0',
  23. 'help' => '',
  24. 'node_options' =>
  25. array (
  26. 'status' => true,
  27. 'promote' => true,
  28. 'sticky' => false,
  29. 'revision' => false,
  30. ),
  31. 'comment' => '2',
  32. 'old_type' => 'editable',
  33. 'orig_type' => '',
  34. 'module' => 'node',
  35. 'custom' => '1',
  36. 'modified' => '1',
  37. 'locked' => '0',
  38. );
  39. $content[fields] = array (
  40. 0 =>
  41. array (
  42. 'widget_type' => 'text',
  43. 'label' => 'Caption',
  44. 'weight' => '0',
  45. 'rows' => '1',
  46. 'description' => '',
  47. 'default_value_widget' =>
  48. array (
  49. 'field_caption' =>
  50. array (
  51. 0 =>
  52. array (
  53. 'value' => '',
  54. ),
  55. ),
  56. ),
  57. 'default_value_php' => '',
  58. 'group' => false,
  59. 'required' => '0',
  60. 'multiple' => '0',
  61. 'text_processing' => '0',
  62. 'max_length' => '',
  63. 'allowed_values' => '',
  64. 'allowed_values_php' => '',
  65. 'field_name' => 'field_caption',
  66. 'field_type' => 'text',
  67. 'module' => 'text',
  68. 'default_value' =>
  69. array (
  70. 0 =>
  71. array (
  72. 'value' => '',
  73. ),
  74. ),
  75. ),
  76. );
  77. Views:
  78. $view = new stdClass();
  79. $view->name = 'Editable_Fields';
  80. $view->description = 'Editable_Fields Views demo';
  81. $view->access = array (
  82. );
  83. $view->view_args_php = '';
  84. $view->page = TRUE;
  85. $view->page_title = '';
  86. $view->page_header = '';
  87. $view->page_header_format = '1';
  88. $view->page_footer = '';
  89. $view->page_footer_format = '1';
  90. $view->page_empty = '';
  91. $view->page_empty_format = '1';
  92. $view->page_type = 'editablefields_list';
  93. $view->url = 'editablefields';
  94. $view->use_pager = TRUE;
  95. $view->nodes_per_page = '10';
  96. $view->sort = array (
  97. );
  98. $view->argument = array (
  99. );
  100. $view->field = array (
  101. array (
  102. 'tablename' => 'node',
  103. 'field' => 'title',
  104. 'label' => '',
  105. 'handler' => 'views_handler_field_nodelink',
  106. 'options' => 'link',
  107. ),
  108. array (
  109. 'tablename' => 'node_data_field_caption',
  110. 'field' => 'field_caption_value',
  111. 'label' => '',
  112. 'handler' => 'content_views_field_handler_group',
  113. 'options' => 'editable',
  114. ),
  115. );
  116. $view->filter = array (
  117. array (
  118. 'tablename' => 'node',
  119. 'field' => 'status',
  120. 'operator' => '=',
  121. 'options' => '',
  122. 'value' => '1',
  123. ),
  124. array (
  125. 'tablename' => 'node',
  126. 'field' => 'type',
  127. 'operator' => 'OR',
  128. 'options' => '',
  129. 'value' => array (
  130. 0 => 'editable',
  131. ),
  132. ),
  133. );
  134. $view->exposed_filter = array (
  135. );
  136. $view->requires = array(node, node_data_field_caption);
  137. $views[$view->name] = $view;