Posted by matthew_ellis24 on February 13, 2008 at 12:27pm
Jump to:
| Project: | CCK Blocks |
| Version: | 6.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Issue Summary
This module is so close to what I want to achieve. But is it possible to view CCK groups as a block rather than individual fields?
Cheers
Matt
Comments
#1
Sure... let's put that down for the 6.x version OK?
If you want to help porting and adding this feature, be my guest!
#2
That would be a task now ;)
#3
I'd love to help, but I wouldn't know where to start!
#4
#5
Anyone any ideas on that topic?
#6
I'm very interested in helping, but I don't know the CCK well enough. Any info would be great.
#7
I took a look at the CCK Blocks module, and it uses $field = module_invoke('content', 'fields'). Would it be possible to do something like...
$field .= module_invoke('fieldgroups', 'groups')
Any ideas? I'd really like to get this moving.
#8
Can you give some examples how you plan to use that feature?
#9
Subscribe.
#10
To get a number of fields into one block!
#11
Yes it would be neat to be able to have a CCK group as a block, for instance lunches of the week: seven text fields where the user can add menu entries. :)
#12
Just adding my opinion that this would be a really, really, really useful feature for CCK Blocks.
#13
+1 I'm using multigroups from cck-6.x-3.x-dev and would love the option to show the group as one block
#14
Suggestion or Dream? :)
Would be great to have a single block with all cck fields (and groups) avaiable inside, with possibility of integration with CCK Fieldgroup Tabs.
Final result: all cck informations for a node could be placed everywhere and not only inside $content, with easily navigation through tabs (optimizing spaces on page).
#15
Same needs here too. I have related fields which would be better in a single block. Aside from everything, it makes the block headings work correctly - all fields under a single <h2> instead of having two or three blank headings.
#16
Looks like this is already being discussed and has working code: http://drupal.org/node/462924
#17
I decided that it was easier to use a custom PHP block than to try to patch the code to get a group showing. This also means I can format the information as needed.
<?php
$node=menu_get_object();
if (isset($node->nid)) {
if ($node->type=='clubhome') { /* this is the type of our OG group home page */
$content = '';
if (isset($node->field_venue[0]["value"])) {
$vnu=str_replace('&','and',$node->field_venue[0]["value"]);
$content .= '<h3><a name="clubdetails"></a>Meetings</h3>';
$content .= "<p>".$vnu;
$content .= " at ".$node->field_time[0]["value"];
$content .= " on ". $node->field_day[0]["value"].".";
if (isset($node->field_notes[0]["value"])){
$content .=" </p><p><strong>Notes:</strong> ".$node->field_notes[0]["value"].".";
}
$content .="</p>";
$content .='<p><strong>';
$content .='<a href="http://maps.google.co.uk/maps?q='.$vnu.'" title="Google Map of '.$vnu.'">';
$content .='Map</a></strong></p>';
}
if (isset($node->field_website[0]["value"])) {
$ws=$node->field_website[0]["value"];
$content .= "<h3>Web Site</h3>";
$content .= '<p><a href="http://'.$ws.'">'.$ws.'</a></p>';
}
return $content;
}
}
?>
#18
Thanks magpie5212 - you gave me an idea!
I don't like putting code directly into node bodies (can be maintenance headache during major version upgrades). But I documented how you could use that idea to put the code in a custom template file:
http://drupal.org/node/1078298
Works a charm!
Hope that helps someone.
#19
subscribe. Very interested!