Hi,

Firstly I would like to say I think Field Group module is superb and has saved me a lot of time and effort, so thanks for your hard work so far.

I am trying to allow people creating new pages to add horizontal tabs to an existing group and add the title themselves, rather than stick to the existing fixed number of tabs with the titles already defined.

What I tried to do was create a Field Collection where the two items were a Horizontal Tab item and a content field (Long text in this case), and set this to unlimited in the content type (fieldgroups-newpage.jpg). The display of these items was nested into a Horizontal Tabs group. There was no way to define the tab names outside of the Content Type config.

What happened was that the display was a list of the tab items as collasible divs (fieldgroups-display.jpg).

What I would like to see is:
1) Dynamically-added tab items displayed as tabs if used with Field Collection (or another method)
2) The ability to define the tab title when creating the page - this could possibly be achieved using tokens pointing to another field?

Are there methods to achieve these things already? Any comments welcome.

Cheers
Paul

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Stalski’s picture

I think you mean Fieldgroup would need to interfere in the multiple fields setting. I must say this is something we didn't want to support from the start. The reason is that fieldgroup is designed to only nest elements (fields, groups, ...).

However, I will give it a try and see if there is someway it's "justified" with fieldgroup in combination with field_collection. And I do realize this feature would really rock.

Stalski’s picture

Status: Active » Postponed (maintainer needs more info)

I tries some cases, but it's not clear to me what you want to achieve.
Can you upload some screenshots how the end result would be like? and all the screens (display and fields ui of the fieldcollection and display and fields ui of the entity itself).
Thx in advance.

paulbarrett79’s picture

Hey Stalski,

I'll get some screenshots up shortly but basically:

  1. It should be possible for someone creating a page from a content type containing a group of horizontal tab items to be able to change the tab text. This is currently defined when creating the template and cannot be changed.
  2. There should be a way of adding unlimited horizontal tab items to a group and being able to specify the tab text. Currently you can have one field listed and be able to add unlimited numbers of that field. This coule be done by creating a new Field Collection consisting of a simple text field for the tab title and a larger textarea for the tab content. Then the horizontal tab item could be autogenerated in the background.

Thanks for having a look at this!
Paul

Stalski’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Hey,
I guess this is again a problem with multiple fields? If this is the case, fieldgroup does not interact on that.
So basically, you cannot use fieldgroup to split your multiple items (delta's) apart. In our opinion, this is not the taks of fieldgroup.

paulbarrett79’s picture

Oh well.

Do you think that this is something for consideration after horizontal tabs gets migrated into Elements?

Cheers
Paul

Stalski’s picture

Not really no. That was a decision we made. You can imagine if we do this, we have tons of features to do ... if fieldgroup needs to know about fields and how they are being rendered (and all render specific stuff that comes with it) , the fieldgroup module will become unmaintainable.
In your case this is fieldcollection field and formatter and thus knowing the rendering is done by entity view.

So I'll have to disappoint you, this will never be integrated in fieldgroup.
When Horizontals are moved to elements, you will be able to use horizontal tabs as elements in the drupal library just the same way as they are now. So you can always write your code that extracts these field_collections AS tabs, but that will be custom.

paulbarrett79’s picture

Fair enough. Thanks for looking into it anyway.

Cheers
Paul