source: sipes/modules_contrib/editablefields/README.txt @ 92213c1

stableversion-3.0
Last change on this file since 92213c1 was 177a560, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se agrego el directorio de modulos contribuidos de drupal

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