Content Construction Kit (CCK)

Events happening in the community are now at Drupal community events on www.drupal.org.

For those who wish to discuss CCK development.

Fohsap's picture

Special permissions to alter null fields and edit existing fields

Functions required:

<

blockquote>
drupal_hook_form_alter()
why? To check to see if fields are or are not null (note that "drupal" will be replaced with a suggested module name for anyone who thinks that this should be modulated)
dropdown()
Preferred/chosen method, due to its being concise. For larger sites, it would probably be best to use some kind of auto-complete function
foreach()
This is used to fill the drop-down with options (the variable $option will be used)
submit()
To initiate actions which will fill the form in question with the user entries made herein

Read more
xjm's picture

hook_widget_settings(): How to only add settings for certain field types?

The Content Taxonomy module provides an option to indent child terms in its select list in the same way that the core taxonomy module does. This option is a checkbox in content_taxonomy_options_widget_settings(), thus:

<?php
$form['settings']['show_depth'] = array(
'#type' => 'checkbox',
'#title' => t('Indent child terms with \' - \' signs'),
'#default_value' => is_numeric($widget['show_depth']) ? $widget['show_depth'] : 1,

Read more
DrupalCuckoo's picture

hook_form_alter() and content types

hi,

I'm bulding a custom module with the purpose to alter the "edit form" of every content type (i.e. the edit form of the blog content type located at admin/content/node-type/blog).

Creating new form elements to extend the standard form with my custom form elements wasn't a problem at all. When I enable my module at admin/build/modules I can see my custom form elements and everything seems to work. Here's what my ".module" file looks like:

<?php
// $Id$

/**
* Implementation of hook_form_alter().
*/

Read more
aleclerc's picture

Custom Block linking to external websites using CCK fields

I'm trying to use Content Profile & CCK to allow users to input some information from various social networks. Right now I'm just using textfield, one for each social network (twitter, facebook, linked in, etc) to input either a link or their username from that social network.

My goal is to be able to create a block so that when people visit their profile, they will have a block that just contain icons representing each of the networks if that CCK field is filled out (i.e. if they've entered that info).

Read more
hamedtaha's picture

linking users to contents!

hello every one ...
well i'm very new to drupal
and i'm making a jobs portal i've created a new content type and i called it positions , and created new user role and i called it job seeker ,

is there any way that if the job seeker click to apply for certain job , to link his profile to this content type ?

Read more
datashaman's picture

CCK field names in JSON service results

When using the block display in views to generate a JSON object for the services module, specifically the views.get method, the names (and hence keys in JSON) generated are decidedly unfriendly.

For example:

{"#error":false,"#data":[{"nid":"56","node_data_field_identifier_field_footer_value":null,"node_data_field_identifier_field_footer_format":null,"node_type":"page","node_vid":"159","node_revisions_body":"","node_revisions_format":"2","node_revisions_teaser":"","node_title":"Career Advice","node_revisions_timestamp":"1266478559","node_data_field_identifier_field_whatsthis_value":"<p>Our career advice section provides you with excellent articles that can help you improve your career.<\/p>","node_data_field_identifier_field_whatsthis_format":"2"}]}

In the above case, I've attached a CCK field 'footer' to the content type, and the view is being accessed with an argument of field 'identifier'.

This wouldn't be so bad if it was consistent in its naming. Here's another example:


[{"#error":false,"#data":[{"nid":"113","node_data_field_footer_field_footer_value":null,"node_data_field_footer_field_footer_format":null,"node_type":"article","node_vid":"213","node_revisions_body":"

Read more
Hugo Estrada's picture

Export and Import Content Type

I need some help.

I need to export and then import a type that I have developed on my local machine. I installed the import export module, but it seems that it is broken, giving me an:

warning: Invalid argument supplied for foreach()

What do I need to do to be able to export and import the types?

I am getting this error if I attempt to export.

Fatal error: Call to undefined function content_copy_groups()

How should I do this?

Thanks in advance!

Read more
anjjriit's picture

need help to create compute code for computed field

hii everybody,

I need help to create simple compute code on my computed field around water meter measurement, and I have to post what i need at http://drupal.org/node/721822, I'm very very needs solution for this simple problem.

Thanks for your help.

Read more
dakke's picture

Performance anno 2010

Can someone shed some light on the performance of CCK when lots of fields are created? An example would be The New York Observer, with 110 fields.

However, is there any specific data out there on how good its performance is in the case of +100 (or more) fields?

Read more
rokr's picture

How to create structured content for editors - CCK on the fly

I have read several posts here about how to get structured content into one node while editing it. CCK is a great and powerful tool but an editor (user) is limited by the way a content type is setup. Yes you can have multiple fields with multiple number of values. And since multigroup is alive again in cck 3 branch this will be much more flexible. What i'm still missing is something like editing a content type (which is done by an admin) - but for a user. Changing the order of fields and putting multiple occurencies into one node.

Read more
ademarco's picture

Node Widget: create and reference nodes on the fly

I've just contributed a new module called "Node Widget", quoting the project description:

Node Widget allows to create and edit referenced nodes (stored in CCK nodereference fields) in the same form used to edit the main content. An editing form for referenced nodes is embedded in the main editing form; it is possible to select which fields should appear in this subform.

Read more
DrupalCuckoo's picture

Create Content Fields "on the fly"

Hi,

I'm building my user profiles with cck and the content_profile module. To explain my problem/question here's a little example:

The user profile containes fields to collect information about himself and his children (birthday, school and gender for each child). Because the quantity of children differ from family to family I don't know how many content fields are needed to be created in the first place (five children, six children … 20 children?).

Read more
DrupalCuckoo's picture

Privacy Settings for Content Types (Nodes)

Hi,

I'm looking for a module/function to set privacy not only to several content fields but to a whole node.

I've created an image gallery content type as descripted in this video tutorial http://www.lullabot.com/articles/photo-galleries-views-attach.

Also I'm using CCK Private Fields (http://drupal.org/project/cck_private_fields) to have privacy functionality within my user profiles (created with content_profile module). Now I can say "show content field xy either to all, friends or nobody. These settings are applied to the content fields and not to the content type.

Read more
husainsn's picture

Access of Location data for a Computed Field

Hello
I have a node type with location data. I want to access latitude and longitude data to calculate Sunrise time in a computed field on the same node - but no success. The code in computed field is:

$lat = $node->$location[latitude];
$long = $node->$location[longitude];
$node_field[0]['value'] = date_sunrise(time(), SUNFUNCS_RET_STRING, $lat, $long, 90, -5);

I can access latitude data $location[latitude] in the theme override, and can calculate sunrise. I want to use the computed field in a View.

Any help will be appreciated.

Read more
bstoppel's picture

Viewreference and Panels via Page Manager

I ran across a problem with using a viewreference inside of a Panel via the cTools Page Manager. As there are numerous modules in the process chain, I am not sure where to report it. So I am starting here.

Essentially, when I try to add a node viewreference to pane, it looses it "Field Format" upon submission. These are the errors I get:

warning: Invalid argument supplied for foreach() in /home/drupal/drupal-6.15/sites/all/modules/cck/includes/panels/content_types/content_field.inc on line 172.
An illegal choice has been detected. Please contact the site administrator.

Read more
sifuhall's picture

Is this possible using cck to define a content type like this?

I have 2 types of content, lodges and members.

Every member can only belong to 1 lodge, and every lodge will have many members.

I have created the members content type and it includes a node reference field that allows the selection 1 of the available lodges (I love that I could create a view to allow users to build the list of lodges).

And now on the lodge pages, I would like to display the members that have selected this lodge in their page.

How can I do this?

Many thanks for the help!

Read more
Andric Villanueva's picture

CCK field development help

I wasn't sure the best place to put this help so I'll do it here.

The module is supposed to be a auto complete field that is a reference to some other data/module that I have going. I have tried the Drupal docs but they are not helpful and I've found a couple (literally two) tutorials on the subject and modifying them doesn't work. The attached file shows what I've done so far with the module being what is really needed.

Read more
markus_petrux's picture

Speeding up a query to retrieve birthdays

Hi all,

I'm wondering if someone else has come to this issue. We need to generate a birthdays view. We're using a Date field in the user profile so users can enter their birthday date. However, querying the date field to retrieve birthdays may impact performance, I think. The view could be cached, but still, when executed against a database of thousands of users, it could impact. So I'm thinking about a way to speed up this kind of queries.

Read more
morisy's picture

Embedding a CCK attached file (imagecache) into a body text as a float

I'm trying to float the CCK body text around an image, but I just can't get it to work no matter what I try. Here is the current relevant code node.tpl.php:

<?php if ($node->field_vendorpic[0]): ?>
     <?php print theme(
         
'imagefield_image',
         
$node->field_vendorpic[0],
         
$node->field_vendorpic[0]["alt"],
         
$node->field_vendorpic[0]["title"]);
    
?>

<?php endif; ?>

<?php  print $node->content['body']['#value']; ?>
</div>
Read more
RalphSleigh's picture

Sorting an exposed noderefence filter based on another field in the referenced node and excluding unused values?

Couple of questions on exposed filters in views.

I have 2 content types:

Gig, has a nodereference to an artist
Artist, has a textfield called sort

The sort field is used to sort the artists more intelligently than just using the name, so I can sort by the last names of people and remove the 'the' from the start of groups.

So I have a view of gigs, and one of the exposed filters is set to the artist nodereference. This produces a dropdown containing all the artist nodes sorted by their title.

A) Is there any easy way to sort the dropdown by the sort field instead of the title?

Read more
Subscribe with RSS Syndicate content

Content Construction Kit (CCK)

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: