[development] noderefernace cck

Marco Carbone marco.carbone at gmail.com
Thu May 28 15:41:26 UTC 2009


Try the experimental content_multigroup module that comes with the
latest CCK release on Drupal 6.  Since it's experimental, you'll have
to add a .info file to enable it.  I have it working right now with a
noderef + checkbox and it is mostly functional.  (There are a few
annoyances that still need to be worked out, such as the inability to
remove empty instances when you allow multiple fields.)

More here: http://drupal.org/node/119102

-marco

On Thu, May 28, 2009 at 8:12 AM, Caleb O'Connell
<caleb at caleboconnell.com> wrote:
> The following is from the noderefernce widget function which looks to be the
> best place to put in my code for adding two free entry text fields.  I
> changed the name to beerlist throughout for my module purposes.  The other
> place would be under nodereference_element, but I am not sure which would be
> best, and if a simple for each would work to create my fields.
>
>
>  switch ($field['widget']['type']) {
>    case 'beerlist_select':
>      $element = array(
>        '#type' => 'beerlist_select',
>        '#default_value' => $items,
>      );
>      break;
>
>    case 'beerlist_buttons':
>      $element = array(
>        '#type' => 'beerlist_buttons',
>        '#default_value' => $items,
>      );
>      break;
>
>    case 'beerlist_autocomplete':
>      $element = array(
>        '#type' => 'beerlist_autocomplete',
>        '#default_value' => isset($items[$delta]) ? $items[$delta] : NULL,
>        '#value_callback' => 'beerlist_autocomplete_value',
>      );
>      break;
>  }
>  return $element;
> }
>
>
> Caleb O'Connell wrote:
>
>> I am looking to get info about the cck module in drupal.  I've been trying
>> to write a cck module that will basically do the exact same as
>> nodereference but with two free
>> entry text fields to go along with it.  Basically, one field to be the
>> noderef lookup
>> and two to add prices to associate to the referred field.  I wasn't sure
>> who I could get in touch with in the cck development who is familiar with
>> this so I can ask some questions about where to put the code I want in
>> place to make the custom module I was
>> looking for.  Thanks again in advance.
>>
>
> --
> -- Caleb O'Connell
> -- Portlandtaps.com
>


More information about the development mailing list