Questions tagged [cck]

The Content Construction Kit is a Drupal module that allows users to add custom fields to content types.

The Content Construction Kit (CCK) is a collection of Drupal modules that can be used to create content types whose nodes follow a defined structure beyond that of a title and a body.

The CCK provides field types and widgets. The user (usually an administrator or developer) adds a field to a content type by selecting a field type, a widget and a name for the field. When a user creates a node of that content type, the widget is displayed and the user can enter data into it according to the field type. This data is saved together with the node that gets created and displayed when the node is displayed.

The CCK provides field types for (amongst others) text, numbers, nodes, users. Widgets for (amongst others) line input, text areas, select lists, radio buttons, checkboxes are available. Additional field types and widgets can be created by developers and some are available as extension modules on drupal.org.

CCK fields are automatically exposed to the Views module.

503 questions
85
votes
10 answers

How to quickly theme a view?

I've defined a view with the CCK and View 2 modules. I would like to quickly define a template specific to this view. Is there any tutorial or information on this? What are the files I need to modify? Here are my findings: (Edited) In fact, there…
Pierre-Jean Coudert
  • 8,873
  • 10
  • 46
  • 59
15
votes
1 answer

Simulate a click in a Google Map

I'm trying to simulate a user click on a Google Map, using API v3, after I geolocate their position when they write down their address. I used to do: google.maps.event.trigger(map, 'click', { latLng: new google.maps.LatLng(lat, lng) }); But now…
penyaskito
  • 511
  • 2
  • 5
  • 16
14
votes
5 answers

Advanced search with Drupal (Views and CCK)

I'm building a site where products are hold in a content type created with CCK. Products can be associated with multiple taxonomy vocabularities. Now I need an advanced product search which user could use to search by many search arguments (taxonomy…
Tuomas Paasonen
  • 141
  • 1
  • 1
  • 5
13
votes
6 answers

Removing [nid:n] in nodereference autocomplete

Using the autocomplete field for a cck nodereference always displays the node id as a cryptic bracketed extension: Page Title [nid:23] I understand that this ensures that selections are unique in case nodes have the same title, but obviously this…
ack
  • 12,201
  • 19
  • 48
  • 69
7
votes
5 answers

How do you remove the default title and body fields in a CCK generated Drupal content-type?

When you create a new content type in Drupal using the Content Creation Kit, you automatically get Title and Body fields in the generated form. Is there a way to remove them?
Craig Hyatt
  • 1,141
  • 2
  • 8
  • 13
7
votes
3 answers

How to list CCK fields by content type in Drupal

To get a list of a content type's cck fields, I was hoping to use: drupal_get_schema('content_type_mycontenttype'); but that leaves out fields with multiple values. Is there a simple call to use to get such a list?
lazysoundsystem
  • 1,801
  • 21
  • 22
7
votes
5 answers

Drupal - How to update a CCK NodeReference field programmatically?

I'm trying to create a node (B type) & assign it to a A type node's CCK nodereference field using node_save() method. $node_type_A = node_load($some_nid); $node_type_A->field_type_B_node_ref[]['nid'] = $node_type_B_nid; $node_type_A =…
user87274
6
votes
1 answer

Drupal 7: how to restrict file access to specific user roles

I need to develop a site on Drupal 7. I have some content types with File fields in CCK. And access to nodes of these types should be granted only to specific Drupal user role. And at any moment site administrator should be able to make these Nodes…
mechmsk
  • 129
  • 2
  • 3
  • 8
6
votes
4 answers

Drupal Content Type (Restaurant) Design

I have one content type Restaurant. For each restaurant, I would like to record their menu. The sample data would look like this: Beverages Coke                         $4.99 Mineral Water           $2.99 Cocktail Blue Lagoon…
Ferry
  • 250
  • 3
  • 8
5
votes
4 answers

Creating Drupal CCK content programmatically/ via API

I am working with a Drupal 6.x system to create exercise / personal training programmes, and am using the CCK with content types of Exercise and Programme, where Programme contains a few header fields and a list of node references to the exercises…
Macros
  • 7,041
  • 2
  • 33
  • 60
5
votes
3 answers

publish content after varification by admin

I have created video gallery with help of cck . I have created a content type. Now My requirment is that when user add video it should not be published to all user.When admin active that content then it should be publish. How can i do this please…
rajanikant
  • 61
  • 1
  • 4
5
votes
3 answers

'add another item' in non-CCK Drupal forms

CCK for Drupal has the handy feature of allowing a single CCK field to accept multiple values via a "add another item" button that results in an array of data in the node. I'm wondering if there's any easy way of adapting this for a non-CCK form…
ceejayoz
  • 165,698
  • 38
  • 268
  • 341
5
votes
1 answer

Add allowed values list programmatically in drupal 7 CCK field "list_text"

I was wondering if i can create programmatically a CCK field instance and insert the "allowed_values" in a single stage. So i tried this: field_create_instance(array( 'field_name' => 'card number', 'entity_type' => 'payment_method', 'bundle'…
thandem
  • 175
  • 2
  • 11
5
votes
2 answers

Add CCK field to custom form in Drupal 7

There was a method with CCK in Drupal 6 to attach a CCK field in our custom form, like: $field = content_fields('field_name'); // field_name is cck field (text_field,text_Area,image_field anything.) $form['#field_info'][$name] = $field; $form +=…
miteshmap
  • 103
  • 1
  • 8
4
votes
1 answer

How to list the fields in a particular node-type?

I would like to generate a list of all the fields in a particular node-type. Looking at the API for content_fields, I tried this: content_fields(NULL, $nodetype); Unfortunately, this returns all the defined fields, not just those in my particular…
moondog
  • 1,477
  • 5
  • 22
  • 33
1
2 3
33 34