I just try to make multigroup with two fields: date and news.
I created three news. And I saw this:
Date
Date
Date
News
News
News
I think this's bad design for unlimited multigroups.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markus_petrux’s picture

Category: feature » support

Nope. You should see:

-- subgroup 0
Date
News
-- subgroup 1
Date
News
-- subgroup 2
Date
News
...

or

-- subgroup 0
Date News
-- subgroup 1
Date News
-- subgroup 2
Date News
...

If you don't see it like that, then maybe you need to update caches or something of that sort.

markus_petrux’s picture

Status: Active » Fixed

Assuming the support request is resolved. Please, re-open if there's still anything else that needs clarification. Thanks

Daniel A. Beilinson’s picture

Status: Fixed » Active
FileSize
147.77 KB

Sorry, i make screen. This's panel with multigroup.

markus_petrux’s picture

It looks like it is displayed as if it was a "standard" field group.

I believe this is something weird in your installation/configuration. If this is not a fresh installation of CCK3, then you may want to try on a separate test site and see what happens, with just CCK3. If that works ok, then there might be something on the other site that's breaking the multigroup rendering.

Another thing you can try... edit the multigroup settings and save, then visit the "Display fields" screen for than content and try with different options for the multigroup itself and the subgroup. Anything changes?

Daniel A. Beilinson’s picture

Component: content_multigroup.module » Panels Integration
Category: support » bug

This's panels integration bug.
I tryed all of display fields screen's values in fresh acquia install, e.g. :-) But I didn't see any reaction at panel page.
Thanks!

Daniel A. Beilinson’s picture

markus_petrux: can you fix this bug?

Daniel A. Beilinson’s picture

Component: Panels Integration » content_multigroup.module

Views have this problem too.
Please, fix it.

markus_petrux’s picture

Title: multigroup display » Panels integration for multigroups

Better title, I guess.

Will be done when I have the time. Patches welcome.

markus_petrux’s picture

@La_ntegral Re: "Views have this problem too."

Probably related to #416154: Synchronized deltas Views integration: Filter on equal deltas in multigroups?

In regards to integration with Panels 3... I've been looking at it. At a first sight, it doesn't look to complex. It seems to me the plan would be to modify the file content_fieldgroup.inc to only expose "standard" fieldgroups, and delegate other groups types to the modules that implement them. Suggestions are welcome.

I'll proceed as soon as I have the time, probably during the course of this week.

markus_petrux’s picture

Version: 6.x-3.x-dev » 6.x-2.x-dev
Component: content_multigroup.module » Panels Integration

CCK/Panels integration has been reviewed a little here: #505278: Panels 3 and multiple node type fields.

Multigroups are now not exposed to Panels. I initially had the idea to leave this job to the multigroup, hence I added a condition to expose only 'standard' groups to panels. But... now I realize there's another possible approach:

Idea: The code in fieldgroup module used to render a field group is located in hook_nodeapi('view') implementation. If we could abstract that code into a separate funcion that takes the $node and $group_name as arguments, such a funcion could be used in hook_nodeapi('view'), but it could also be used for the render method of Panels integration of fieldgroups.

So, I'm tranfering this issue to Panels integration for CCK2. If my idea is possible, then the same patch here would be valid for CCK2 and CCK3. The fieldgroup module would have a new function that can be used to render a group, as long as you know the name of that group and give it a $node. Then, Panels integration of field groups would be able to deal with all kind of field groups. So support for multigroups would be transparent.

Such a function would be the counterpart of content_view_field() for fieldgroups. It could look like: fieldgroup_view_group($group, $node, $teaser = FALSE, $page = FALSE).

Sounds good?

Daniel A. Beilinson’s picture

Sounds pretty good if it possible! :-)
Unfortunately, I can't see new dev version of CCK3 with patches from your link.
Maybe I can create views pane with patches from #9's link? What do you think? One problem is about this patches who can't work for me :-(
Well, I think one of solutions for me - new flexifield with views integration.

markus_petrux’s picture

Status: Active » Needs review
FileSize
9.94 KB

Here's a first patch that implements fieldgroup_view_group(), which is the counterpart of content_view_field() used for fields, but now able to deal with field groups.

I would appreciate a review and testing, because the code in fieldgroup_nodeapi() now has been externalized into a separate function fieldgroup_build_content() which is also used by fieldgroup_view_group().

Once this is validated, then it's just easy to review the field groups integration in Panels, and also add support for multigroups.

The attached patch should be valid for CCK2 and CCK3 code.

markus_petrux’s picture

Patch re-rolled for CCK2.

It includes the function fieldgroup_view_group() introduced in #12 (including minor fixes I noticed when playing with multigroups), and it also modifies the integration of fields and field groups a little. Labels and panel options are now a bit more consistent, I think.

Next, will come a patch for CCK3 that includes support for multigroups, finally.

markus_petrux’s picture

And here's the patch for CCK3. It is the same as #13, but includes changes to the multigroup module.

I'm also attaching the file content_multigroup.inc that needs to be copied to:

cck/modules/content_multigroup/panels/content_types/content_multigroup.inc

I was not able to include this file in the patch. :-/

Daniel A. Beilinson’s picture

Okay.
When I try to add to my view fields date and news I see them in good format:
date
news
date
news
But when I try to add argument - node:nid, I have old:
Date
Date
News
News
Panels can't see this. And when I decided to add another multigroup through panel's content I saw no multigroups there. content_multigroup.inc is here: /var/www/apache2/html/sites/all/modules/cck/cck/modules/content_multigroup/panels/content types

So. If we have this function, could we use fieldgroups in views? I mean filter of maybe fieldgroups like fields?

markus_petrux’s picture

Your path is wrong. This: "sites/all/modules/cck/cck/modules/content_multigroup/panels/content types"

It should be "sites/all/modules/cck/modules/content_multigroup/panels/content_types"

Note 2 errors:

1) You have posted cck/cck (twice).
2) The last subdirectory should be "content_types", not "content types".

--

In Panels 3, you should be able to add a "multigroup" content. And then you should be able to select different formatting options that are related to multigroups. If you add the fields in multigroups to the panel directly, then these fields will be rendered as multiple value fields, as if they were not part of a multigroup. You should add the "multigroup" content.

--

The function fieldgroup_view_group() is aimed to be used for custom development, yes. It can be used everywhere you can use content_view_field(), as long as you supply a node with all fields populated, and a $group structure. This function should be able to render a multigroup as well as any other field group.

--

What I need to validate the patches, aside from checking it works in panels, I also need feedback on whether field groups and multigroups are still rendered correctly in normal node view pages. This is because I have abstracted the code that was present in fieldgroup_nodeapi() into a separate generic funcion. It should work, but feedback here is also more than welcome. 4 eyes can see a lot more than 2. :)

Daniel A. Beilinson’s picture

Yeah, I've got error 2) and forget to rename inc (content_multigroup.inc_.txt).
Great! It is great! But I see one thing: Multigroup or Field group format: it's very strange option. Group's can't be collapsible in Panels (but can be hide if you chose collapsed format:-), so I see another design for collapsible groups (and it's look very cool), but not anything collapsible.
I can't see any unusual things in normal node view, so - very very good, thank you!
But I don't understand what we can do with views. As I said - views shows multigroups in wrong format. Maybe it is possible to choose groups like field? And when we could catch refferencing from multigroups and we could sort that views, because flexifield couldn't do this - flexifiled is one field.

markus_petrux’s picture

Great! It is great! But I see one thing: Multigroup or Field group format: it's very strange option. Group's can't be collapsible in Panels (but can be hide if you chose collapsed format:-), so I see another design for collapsible groups (and it's look very cool), but not anything collapsible.

I think the fact that fieldset cannot be collapsed in Panels is a panels bug. I just played with panels preview and also saw this. Maybe it just affects preview? In any case, Panels should be able to render any kind of element as long as it is built using Drupal rendering methods. A fieldset has a theme associated to it, and that outputs the proper javascript as necessary.

Edited: just checked with latest Panels 3 dev, and fieldset can be collapsed perfectly well on panels. It is just a preview bug, well, probably something that's on a todo list (panels is still in the works). So... format options provided for field groups and multigroups should work well on panels (just preview fails, but that's a panels issue).

I can't see any unusual things in normal node view, so - very very good, thank you!

Sweet. I would just wait a little more to see if someone else can confirm this. And then, I think it could be committed.

But I don't understand what we can do with views. As I said - views shows multigroups in wrong format. Maybe it is possible to choose groups like field? And when we could catch refferencing from multigroups and we could sort that views, because flexifield couldn't do this - flexifiled is one field.

This issue has nothing to do with views. We have created a function that can be used to render fieldgroups. This function is now reused for normal field group rendering as well as for Panels integration. Others can use this function in contrib/custom modules. But this has nothing to do with Views integration in CCK, Field groups, Multigroups.

Regarding views integration for multigroups, please refer to: #416154: Synchronized deltas Views integration: Filter on equal deltas in multigroups. There's a patch that needs testing.

Thanks for the feedback.

markus_petrux’s picture

Status: Needs review » Fixed

Committed the patch in #13 to CVS (CCK2).
Committed the patch in #14 to CVS (CCK3).

markus_petrux’s picture

As requested by yched (#518596: How to render a single field group?) I have committed fieldgroup_build_content() and fieldgroup_view_group() to D7.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.