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 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.
Comment | File | Size | Author |
---|---|---|---|
#14 | content_panels-495582-14-CCK3.patch | 21.05 KB | markus_petrux |
#14 | content_multigroup.inc_.txt | 5.95 KB | markus_petrux |
#13 | content_panels-495582-13-CCK2.patch | 20.16 KB | markus_petrux |
#12 | fieldgroup_view_group-495582-12.patch | 9.94 KB | markus_petrux |
#3 | multigroup.jpg | 147.77 KB | Daniel A. Beilinson |
Comments
Comment #1
markus_petrux CreditAttribution: markus_petrux commentedNope. 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.
Comment #2
markus_petrux CreditAttribution: markus_petrux commentedAssuming the support request is resolved. Please, re-open if there's still anything else that needs clarification. Thanks
Comment #3
Daniel A. Beilinson CreditAttribution: Daniel A. Beilinson commentedSorry, i make screen. This's panel with multigroup.
Comment #4
markus_petrux CreditAttribution: markus_petrux commentedIt 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?
Comment #5
Daniel A. Beilinson CreditAttribution: Daniel A. Beilinson commentedThis'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!
Comment #6
Daniel A. Beilinson CreditAttribution: Daniel A. Beilinson commentedmarkus_petrux: can you fix this bug?
Comment #7
Daniel A. Beilinson CreditAttribution: Daniel A. Beilinson commentedViews have this problem too.
Please, fix it.
Comment #8
markus_petrux CreditAttribution: markus_petrux commentedBetter title, I guess.
Will be done when I have the time. Patches welcome.
Comment #9
markus_petrux CreditAttribution: markus_petrux commented@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.
Comment #10
markus_petrux CreditAttribution: markus_petrux commentedCCK/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?
Comment #11
Daniel A. Beilinson CreditAttribution: Daniel A. Beilinson commentedSounds 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.
Comment #12
markus_petrux CreditAttribution: markus_petrux commentedHere'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.
Comment #13
markus_petrux CreditAttribution: markus_petrux commentedPatch 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.
Comment #14
markus_petrux CreditAttribution: markus_petrux commentedAnd 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. :-/
Comment #15
Daniel A. Beilinson CreditAttribution: Daniel A. Beilinson commentedOkay.
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?
Comment #16
markus_petrux CreditAttribution: markus_petrux commentedYour 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. :)
Comment #17
Daniel A. Beilinson CreditAttribution: Daniel A. Beilinson commentedYeah, 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.
Comment #18
markus_petrux CreditAttribution: markus_petrux commentedI 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).
Sweet. I would just wait a little more to see if someone else can confirm this. And then, I think it could be committed.
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.
Comment #19
markus_petrux CreditAttribution: markus_petrux commentedCommitted the patch in #13 to CVS (CCK2).
Committed the patch in #14 to CVS (CCK3).
Comment #20
markus_petrux CreditAttribution: markus_petrux commentedAs requested by yched (#518596: How to render a single field group?) I have committed fieldgroup_build_content() and fieldgroup_view_group() to D7.