Now that I'm tackling APK for D6, I'm back to working on the same stuff that got me writing the panels / fieldgroup integration to begin with. First off, it seems that the parameters have changed for the bit that prints the content. On line 24,
function fieldgroup_panels_render_fieldgroup($conf, $panel_args, $context) {
needs to become
function fieldgroup_panels_render_fieldgroup($subtype, $conf, $panel_args, $context) {
That gets the $node variable properly filled with the node context.
Then the next problem is that theme('fieldgroup_panel', $vars, $node->nid) is no longer valid because the theme system changed. I believe we either need a .tpl file for it, which is probably overkill, or to register the theme function. Registering it just means adding it to the existing function:
/**
* Implementation of hook_theme().
*/
function fieldgroup_theme() {
return array(
'fieldgroup_simple' => array(
'template' => 'fieldgroup',
'arguments' => array('element' => NULL),
),
'fieldgroup_fieldset' => array(
'arguments' => array('element' => NULL),
),
'fieldgroup_display_overview_form' => array(
'arguments' => array('form' => NULL),
),
'fieldgroup_panel' => array(
'arguments' => array('vars' => NULL, 'nid' => NULL),
),
);
}
In doing that, I realized "vars" is really a poor choice of names for that variable. I'm not sure what to call it, though. Any suggestions? Also, I think the smallest bit is a "pane" not a "panel" so fieldgroup_panel should probably be changed to fieldgroup_pane.
If you want, I can do this all up as a proper patch. I wanted to get your input first, though, to make sure I have everything how you want it so I don't need to reroll. I'm hoping this can get in soon as APK will depend on it working.
Thanks,
Michelle
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | fieldgroup.panels.txt | 3.98 KB | michelle |
Comments
Comment #1
yched commentedWe now have a content_view_field() function, that takes care of generating the output for a field.
So the
if ($node) {...}part could become something like (untested) :Which makes the code less coupled to the actual structure of the render array.
Comment #2
michelleThanks! I'll be working on this again later today and will give this code a whirl.
Michelle
Comment #3
michelleSorry this took so long to get back to. Here's the revised code, with your suggestion used and the rest cleaned up. It's working fine for me.
Still needs the addition to fieldgroup_theme() as noted in the first post.
(Change .txt to .inc)
If you're ok with this, can we get it in? We can always tweak it more later if needs be. What's currently in there is broken and this isn't so it's a step up, I think. ;)
Thanks,
Michelle
Comment #4
patchak commentedTried this code on a test site that uses all the latest versions of cck (dev version) panels, (latest alpha 3 version).
I tried to insert existing fieldgroups in panels and it does not work I only get a message like this :
"d
Content fieldgroup content goes here."
I tried with existing and new fieldgroups. I inserted this file in the cck/modules/fieldgroup folder, is that the right place to insert it? I guess it is ...
After emptying the cache, creating new fieldgroups, new fields, new content type... can't get the old behaviour to go away on this one... does not seem to work at all from here. Is there any detail I missed? Maybe panels v. alpha3 changed something??
Patchak
Comment #5
michelle@patchak - That text isn't even in this version. That's what it says in the original, broken version.
Michelle
Comment #6
patchak commentedI will have to re check all the versions I use.. Michelle could you post exactly on which version on cck and panels you got this to work so I can test again having the same versions as you do ? thanks
Patchak
Comment #7
michelleI'm using the latest devs. But that's not the point. The text you posted is in the broken version currently in CCK which means you didn't replace it with the updated file. You aren't getting it to work because you're not using the code from this issue. You need to add to the theme function in the .module and replace the .inc file.
Michelle
Comment #8
patchak commentedHummmm I did not get that I needed to add anything to the module file, sorry about that. I just replaced the actual .inc file. Will add that theme function and the report back here.
Thanks for your time,
Patchak
Comment #9
yareckon commentedpatchak, I was also confused by the thread in to thinking this was in a dev version. I guess for this to be in the dev versions we would need somone to commit Michelle's patch to cvs. Which would be awesome of them, as this feature is broken!
Comment #10
michelleCorrect, the code needs to be committed before it will be in a dev version.
Michelle
Comment #11
yched commentedWell, I would have liked to get at least a positive review from another person before committing, but it looks like this won't happen, and we can't really break something that's currently broken, so I went ahead. Committed. Thanks Michelle.
I'm still not a fan of theme_fieldgroup_panel(), BTW. No real suggestion, but I feel there should be a better way...
Comment #12
michelle@yched: Yeah, as I said in #3, we can always tweak this more. The first step was getting it to _work_ at least so people can use it. I'd like to give the code a good going over and improve it but first I need to get this client work done and APK 1.0 out and having a working fieldgroup integration will help with both of those.
Thanks for committing it,
Michelle
Comment #13
wallbay1 commentedHey guys can someone please help me fix that problem
please give me a step by step instruction I am not a very wise coder actually i m not a coder at all :)
Comment #14
michelle@wallbay1: What problem? This issue is fixed and I see no other comment by you on it.
Michelle
Comment #15
wallbay1 commentedwhat I mean is
I am getting the "content goes here.."
am i suppose to use Dev version? I m confuse
Comment #16
wallbay1 commentedNever mind Michelle,
I just had to put dev version of cck. everything works fine thanks for the help