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.
Basically I have custom made content type with two fields (body and image) inside each field group.
I want to allow user to press on the button that creates field group with body and image fields inside it. (just like in attached image)
I have googled this for about 3 hour and I am real php newbie so please don't judge.
I will appreciate any tip.
Thank you.
Comment | File | Size | Author |
---|---|---|---|
problem.jpg | 116.64 KB | ivars211 |
Comments
Comment #1
boombatower CreditAttribution: boombatower commentedUse ctools exportables since field_group supports them now. See field_group.api.php hook_field_group_info(). To get a full example, create a field_group and enable the ctools bulk export module and export the field group using that. Once you take a look at the code simply determine how it fits into your usecase to pragmatically create fieldgroups.
Comment #2
Stalski CreditAttribution: Stalski commentedTx boombatower. That is correct.
@ivars211: Let us know if you figure it out.
Comment #3
ivars211 CreditAttribution: ivars211 commentedThank you for your replies. I tried to export and look through the code in hook_field_group_info() function but without success.
I am making step-by-step tutorial type website. So I would like to allow user to press on the button(add step) which displays my field group tabs(steps) with js (they could be hidden by default for example). I think horizontal-tabs.js is the file which I am looking for, but I have no idea how to do that.
Thank you again.
Comment #3.0
ivars211 CreditAttribution: ivars211 commentedinformation
Comment #4
nils.destoop CreditAttribution: nils.destoop commented