The original use case was to provide pages for which an end user could add an arbitrary number of tabs (all with the same structure).

The patch does the following things:

- Implements displaying each group member in individual tabs, if the multigroup module is enabled. View only; it does not implement showing the edit form for multigroup in individual tabs.
- Allows providing a field name whose value will be used as the tab title
- This behaviour is configurable on a per Content type basis
- As a side effect, it is now possible to enable or disable the Basics tab on a per content-type basis
- Module update will migrate configuration value for Basics tab

This is NOT the same as http://drupal.org/node/385598 (Incompatibility with content_multigroup module)

Comments

benoitg’s picture

Here is an improved patch, adding a preference to allow for skiping creating tabs from multigroup if only one would be created, and the basics tab isn't enabled.

benoitg’s picture

Forgot to say, this patch exposes a CCK Multigroup bug, for which the patch hasn't beeen commited yet: http://drupal.org/node/663606

Make shure that the CCK patch has been applied before testing this one.

nedjo’s picture

Thanks for the patch, I'm interested in seeing this applied though I haven't found time yet to review it.

nedjo’s picture

Thanks for this innovative patch, apologies it took me so long to review.

I agree almost everything here is useful and desirable. But I hesitate to put most of it into cck_fieldgroup_tabs.

Pieces that seem to belong instead in content multigroup module:

1. Ability to select a rendering style for fieldgroups within a multigroup.
2. Ability to designate a field to use as the fieldgroup title.

Have you considered patches on CCK?

benoitg’s picture

>Thanks for this innovative patch, apologies it took me so long to review.

Don't worry, I know how it is ;)

>I agree almost everything here is useful and desirable. But I hesitate to put most of it into cck_fieldgroup_tabs.
>
>Pieces that seem to belong instead in content multigroup module:
>
>1. Ability to select a rendering style for fieldgroups within a multigroup.

Agreed, but i didn't deal with that issue at all.

>2. Ability to designate a field to use as the fieldgroup title.

I do not believe so. For a standard fieldgroup, there can only one instance, so the fieldgroup name is a logical place to put the tab title. In the case of multigroup, there is only one fieldgroup name, but there can be multiple instances of it. So I cannot use the fieldgroup title in this context, since there is only >one< for the entire group; all tabs would have the same title.

I believe this approach is better: It's non-disruptive, and leverages exactly what multigroup offers: defining dynamic repeating data structure. In my opinion giving special meaning (tab title) to one field does belong to the tab module.

>Have you considered patches on CCK?

I did send one while working on this (http://drupal.org/node/663606)

benoitg’s picture

Wow, there has been some major refactoring of the module in the dev version. Not a single hunk of the patch applies now. Trying to port.

benoitg’s picture

Ok, ported the patch to new dev version (retrieved 2010-02-18). Part of my patch becomes unnecessary (enabling basics tab by content type), the rest is a bit simpler.

See attached patch.

benoitg’s picture

Assigned: Unassigned » benoitg
StatusFileSize
new21.07 KB

Ok, here is another version, hopefully it has a better chance of being integrated.

Compared to last patch:
- This time, all the multigroup specific code is split in it's own submodule.
- Add the option to repeat the content of the basic tab on every tab (very usefull for images, sidebars and the like)

Now the only changes to the base module are those necessary to
- define two new hooks:
- hook_cck_fieldgroup_tabs_add_fieldgroup_tab
- hook_cck_fieldgroup_tabs_process_residual
- Move the current code to use the hooks
- Make the content_type form alterations independent of the module load order.

benoitg’s picture

One more revision, there was a bug when activation repeat residual content, where the content would disapear if no tab was created.

Also uses this opportunity to deal with content_extra_fields.

benoitg’s picture

Minor update (only touches the multigroup_tab module). Improves cck_multigroup_tabs.module to process residual content when tabs aren't displayed and there is a single group elements in the same way as within a tab. Otherwise, it becomes very difficult to write common CSS layouts.

clashar’s picture

I do receive an error while trying to install patched module:

Parse error: syntax error, unexpected ':' in /...
...sites/all/modules/cck_fieldgroup_tabs/cck_fieldgroup_tabs.module on line 152

No problem for others?

Maybe I should apply patch for all 6 versions step by step? (I have only used the last one- v.6)

nedjo’s picture

This is a welcome enhancement. However, it's such a significant expansion of the code that I would be comfortable applying it only if you were able to comaintain the project, benoitg. Is that an option?

Minor coding standards issues, e.g., variables should use lower case and underscores rather than camel case.

clashar’s picture

again,
should I apply patch for all 6 versions step by step? or 6th version is all included?

clashar’s picture

If there will be cumulative patch or/and including in dev. version?

clashar’s picture

benoitg,

I tried to apply patches to the latest dev version.

Patches 1 and 2 could not be applied even partially. I suppose it's ok, as you said in #7.

I applied Patch 3 without problem.

But Patch 4 gives me a problem, even if it's applied, because I couldn't apply 5 version further.

Then I looked inside of patched module after 4 version, and it seems that it applies to himself, I mean patch 4 is applied to patch 4.
Is it possible/ok?

See lines 156-158 of cck_fieldgroup_tabs_multigroup_support_v4.patch


diff -u -r -N ../cck_fieldgroup_tabs_orig/cck_fieldgroup_tabs_multigroup_support_v4.patch ./cck_fieldgroup_tabs_multigroup_support_v4.patch
--- ../cck_fieldgroup_tabs_orig/cck_fieldgroup_tabs_multigroup_support_v4.patch 1969-12-31 19:00:00.000000000 -0500
+++ ./cck_fieldgroup_tabs_multigroup_support_v4.patch 2010-02-19 17:25:14.000000000 -0500

clashar’s picture

benoitg,
actually patch 4 could not be applied also. I think the problem is that all these patches are not to latest dev. version.

please make cumulative patch for the latest dev version.

manumilou’s picture

Assigned: benoitg » manumilou
Issue summary: View changes
StatusFileSize
new6.57 KB

This new version mostly includes the hook implementation. CCK Multigroup Tabs must be installed separately and can be found here.
Tested on the latest dev version and it applied well.