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

fokkezb’s picture

Assigned: Unassigned » fokkezb

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!

fokkezb’s picture

Category: support » task

That would be a task now ;)

matthew_ellis24’s picture

I'd love to help, but I wouldn't know where to start!

fokkezb’s picture

Status: Active » Postponed
Anonymous’s picture

Version: 5.x-1.1 » 6.x-1.x-dev
Assigned: fokkezb » Unassigned

Anyone any ideas on that topic?

jonathan.kim’s picture

I'm very interested in helping, but I don't know the CCK well enough. Any info would be great.

jonathan.kim’s picture

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.

Anonymous’s picture

Can you give some examples how you plan to use that feature?

ManyNancy’s picture

Subscribe.

shunting’s picture

To get a number of fields into one block!

Boletus’s picture

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. :)

andrewtf’s picture

Just adding my opinion that this would be a really, really, really useful feature for CCK Blocks.

perke’s picture

+1 I'm using multigroups from cck-6.x-3.x-dev and would love the option to show the group as one block

Dret’s picture

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).

magpie5212’s picture

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.

doublejosh’s picture

Looks like this is already being discussed and has working code: http://drupal.org/node/462924

magpie5212’s picture

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;    
  }
} 

?>
jfall’s picture

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.

Melissamcewen’s picture

subscribe. Very interested!