is there a easy way to duplicate cck field with the same propeties just to make it a diffrent nam开发者_运维百科e?
Yes there is. Edit: I see now you said cck field, but I read "cck type" instead :/
To use an existing field: See Gokul N K's answer. Basically you:
Go to "Manage Fields" for your content type and under Existing field, add a new label and choose the field you want to use from the dropdown.
To duplicate an entire content type:
- Enable the "Content Copy" module of CCK
- Navigate to
admin/content/types/export
and choose the content type you wish to copy - Click "Export"
- Choose all the fields you want to include in the export
- Click "Export"
- You will see a bunch of code output to screen in the "Export Data" box
The first few lines of the code need to be changed (to change name). Edit the first few lines as needed, for example:
$content['type'] = array (
'name' => 'NEW NAME',
'type' => 'new_name',
'description' => 'A new content type with all similar properties of another',Copy everything from the "Export data" box
Click the "Import" tab at the top of the screen (or navigate to
admin/content/types/import
)Paste everything into the "Import data" box, make sure "Content Type" is
<Create>
, and click "Import"
Oops looks like I am missing something :(
I think you can go the content-type manage fields(admin/content/node-type/page/fields
page for example), there is an option called existing field
.
From the drop-down you can select any of the fields that you have already created
and then just give it a new label.
I think this should work. Let me know if you are looking for something else.
Just created a module that does this - I needed to clone fields within a content type and I couldn't find a quick and easy solution.
Have a look at: Content Clone Field
A release should be available within the next 12 hours. Hope this helps.
精彩评论