Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I create a content type which contains a field_collection.
The default look of field_collection in node edit form is not suite my need,so I have to theme it.but I hadn't find any document for such situation.
in a node edit form, field_collection seen to use js to add or delete item,not the ajax way of D7.and field_collection edit form seen to have no form-id, which may be used for theme form.
so there is a way to do this? or any code example to demonstrate it?
Comments
Comment #1
sevanden CreditAttribution: sevanden commentedSame issue here:
A date field that collects an end-date is displayed using multiple lines on the edit form.
Not exactly what I wand and I wonder how to change that.
Comment #2
felgharb CreditAttribution: felgharb commentedSame issue here,
I dont know if you got a solution, if yes I would be interested on that.
I am trying to theme a field item collection and still cannot render the object entity...
Do you know how to render the [#entity] in the $form ?
Comment #3
Senpai CreditAttribution: Senpai commentedCan't see that this is a 'major' issue for a release blocker.
Comment #4
jmuzz CreditAttribution: jmuzz commentedNot sure what the situation was when this was written but there are no javascript files in the module and it does use the built in ajax in the form API.
To change how the form appears you will need to make a custom widget for field collections. Take a look at the field_collection_table module and the widget code in field_collection for examples.
Hope this helps.