Drupal: re-use same CCK Field in the same content type - drupal

I need a sequence of text, image, video CCK fields, repeated twice in my content type.
I need to create 2 different groups (I don't want to use multi-upload functionality).
I was wondering if I have to create a new field Image - File Upload for the second group, or I can somehow to re-use the first one (which is already added, and I would like to add it twice in the second group as well).
thanks

Enable Content Copy module from CCK package. It provides CCK fields import/export functionality.

I've solved by creating 3 groups, and creating image1, image2, image3... video1, video2, video3, and text1, text2, text3 CCK fields. Any order is now possible.

Related

Creating a list out of single entities

2sxc question. I have a lot of single entities of a content type that I want to combine into a list. Essentially, I have four columns and each column has an individual 2sxc content module in it. The column layout is controlled by DNN content panes. What I want to do is create a list template for that content type and add those individual items to the list. The columns would be created in the list template dynamically.
Is this advisable, or am I better off just recreating the content and using a new list template. If it is feasible, what steps would I have to take to make the conversion.
Thanks
This is very easy. The only question is if you want to manually choose which items to show in the list, or if you want to query it like a DB.
Manual approach: create a new template, say it's a list, and you're ready to go. You'll have to add "demo-items" and then "replace" them with the real one, so the initial setup has a lot of clicking.
Query-approach: create a new template, but then loop over the App.Data["Type"] instead of the Data["Default"]
ok?

Make Drupal 7 Group by always show grouping field

I have a Drupal 7 view similar to the one described here: Drupal 7 Views - list group by field
I wish to have all the groupby fields always appear even if there are not members of them and ideally I wish to put a default value in such a list.
eg:
Foo:
-Jay
-George
Bar:
-Barry
Boo:
Sorry no entries at this time!
Suggestions?
If none of what you are fetching with the view is associated with the group 'Boo' then the view doesnt know it exists, so would never be able to show it but say there is no results for it.
What i would recommend is creating a taxonomy vocabulary with the terms: Foo, Bar, Boo.
In whatever content type your names belong to, create a term reference field, and link them to the terms.
In the view, fetch the taxonomy terms, create a relationship to the content type that references the taxonomy, and pull those through based on that. There is a setting in views for multiple results to combine into one field (so you would want to do that). Then you could add the 'Sorry no entries at this time!' as a field's no results text.
So to recap: VIEW => TAXONOMY TERMS => NAME CONTENT

Drupal Profile2 / Field collection sorting records

As continuation of this article Drupal nested / complex / sub content types I have a new question.
As described, using Profile2 and Field collection I've managed to create multi-user CV management system:
Created a content type called CV.
Added a field_collection field to CV called education and allow unlimited entries.
Edited the education field_collection item and add a date field and a text field.
Did the same for work experience and any other fields.
Unfortunately, users should be able to reorder the records (date-text), e.g. to put some of the entries before others. For the moment being they appear in the order of their input.
How to achieve that?
Thank you!
The image below shows a field collection I have made with 3 fields.
One the left of each collection item is a drag handle.
You can re-order content using these handles.

drupal 7, pre populate field values from previous data

My situation is, when I click to add new content of lets say type "project", I want the fields be prepopulated with last entered values.. Since there is more then 40 fields, i don't want to fill every field individually..
Thanks
Well the answer may not be so simple. The best way i can think of is to create a custom module, hook_form_alter the node-edit form and change the #default_value of the form fields/elements you care about.
So in the defualt_value attribute of this you could implement a custom function that brings the data you need or hardcode the values
use devel module in drupal it creates content manually for specific content type i think it useful 4 u

Drupal Custom CCK field with multiple child fields

Is there a way of creating a composite field that can have multiple values, with each value having another group of composite values?
E.g. we want to have this structure at the end:
Group 1 (unlimited number of groups)
Child field (unlimited children for each group)
Child field
...
Group 2
Child field
Child field
...
...
Is this possible at all for a custom module that defines a CCK field? If so, can someone push me in the right direction?
this is a very know and debated issue in the drupal world.
this feature is called cck "multigroup" and it looks it's pretty difficult to implement.
there are a lot of posts in the drupal forum about this, i suggest you to start here:
http://drupal.org/node/494100
it's a kind of "hidden" feature in the cck module. looking in the module directory, you will find instructions here:
cck/modules/content_multigroup/README.txt
Edit: Ongoing work on the multigroup module has moved to the experimental
CCK 3.0 branch.
in the meantime you can try to deal with it using the flexifield module
(but it's kinda hackish, i won't use it in production)
I ended up creating my own "Cost/Product" CCK compound field based on this excellent tutorial with example modules: http://poplarware.com/es/articles/cck_field_module
I haven't figured out yet how to pull out a specific sub-field, such as cost, in Views. I only get the entire ": $" compound.
For Drupal 7+, you probably want to check out the Field collection module, or Field group if multiples aren't necessary.
This issue is pretty old, but I just happened across it. I would think the way to handle it for now would be with a second cck type for the children, and the groups as a node_reference field. So you'd have:
MasterType
group field
unlimited per node
each one, a reference to a ChildType node
ChildType
child field
unlimited per node

Resources