-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
142 lines (137 loc) · 3.27 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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;