3

Currently we are migrating our intranet from plone 2.5 to drupal 7. Everything works out pretty well except one problem we are facing with the cck module.

In plone we had one content type "application" which allowed our members to applicate for a specific project. There were many input fields for describing the required qualification from other projects like in the following "image".

project                        description
[                             ][                         ] + - up down  
[                             ][                         ] + - up down
[                             ][                         ] + - up down
add new row

Our member had the possibility to mention an unlimited number of projects and associated descriptions.

So the problem is, i´m unable to do anything similiar in drupal 7.

I could definitely add an unlimited node reference field and an unlimited text field, but there would not be any kind of relationship between the two fields and the user would have to click "add another entry" twice.

Another option would be the use of the module http://drupal.org/project/tablefield but its not possible to use the first column as a node reference.

I´ve browsed through every cck module available and found nothing really helping, so now i hope you can help me!

Thank you

jumper
  • 165
  • 1
  • 8

5 Answers5

6

Have you tried the field collection module?

This helps you add a collection of fields as a single field. So you could have 'Projects' as a "field collection" type field have unlimited number of values. You can then add the individual field like the Project name, description, etc. in the field collection.

This module is for D7.

stevenw00
  • 1,155
  • 1
  • 13
  • 22
user1611309
  • 76
  • 1
  • 3
  • Thats exactly, what i ended up using (after a lot of bugs were ironed out)! Thank you very much for your answer! – jumper Jan 29 '13 at 17:04
2

New answer to an old question (but isn't that how Drupal usually works): you might want to try the Multifield module as an alternative to Field Collection or the other solutions posted here. It's meant for this type of problem.

Dave Reid
  • 1,260
  • 7
  • 12
0

For Drupal 8 you can also look into the Paragraphs Module for handling a multiple field with multiple inputs. Can be used for product properties, recipes and more advanced use case where a single field can behave like a content type.

There is also a module for Drupal 7 and Drupal 8 called Double field

eye-wonder
  • 1,181
  • 9
  • 17
0

The module Field group is creating this relation for you.

Artusamak
  • 2,470
  • 19
  • 19
  • The field group is creating a relation between all projects and all descriptions, i need a relation between one project and one associated description. – jumper Mar 09 '11 at 16:47
  • Maybe that you will have to store that relation manually, once you submit your format, store which description is related to which project. – Artusamak Mar 09 '11 at 16:51
  • Im not sure what you mean, but it is impossible for the user to create an application with a (node) reference to the project and then creating several new "project experiences" with a (node) reference to the application. Then the user has to create maybe 20 nodes to create one project application. btw, thx alot for your help! – jumper Mar 09 '11 at 16:59
  • Your use case is tricky. You want to create nodes during a node creation. The only solution that i could see is to alter the node form creation by programmatically adding a title and description field, not through the field API because you don't want those fields to be stored in you database, those fields are helpers to programmatically create the node and then you add the node reference with the created node to your "parent node". Do you get it? – Artusamak Mar 10 '11 at 09:11
  • okay, and how to do it? my php skills and knowledge of the drupal api are somehow limited... – jumper Mar 11 '11 at 01:55
  • Take a look at the Schema API / hook_schema() to create your tables. Use the #submit property of the Form API to add callback when you submit a form. Use the hook_form_alter() to add extra fields to your node form. Use Field group module for the multiple fields. – Artusamak Mar 11 '11 at 09:23
  • http://poplarware.com/es/articles/cck_field_module - Ive just found a really good guide to achieve the functionality in Drupal 6. What do i have to change for Drupal 7? It seems like this is a really hot topic in the Drupal community. – jumper Mar 11 '11 at 16:11
0

In Drupal 6 we can do this using Flexifield The project description page of flesifield says that similar functionality can be achieved in Drupal 7 using Combo Field. But I have never tried it though. It might worth giving a try.

Gokul N K
  • 2,428
  • 2
  • 32
  • 40
  • http://drupal.org/project/combofield:Project Information: Maintenance status: Unknown, Development status: Unknown, Last modified: September 5, 2009 Not a single release available... any suggestions? – jumper Mar 10 '11 at 16:26