I don't know if I should post my question here, but I'll give it a try.
For a charity website I'm looking for a solution to have a cck (number or money) sum up in the header.

Explan.: users can give a idea (title,text,saved money) to the website. If published by editor the node is published and the number of the "savedmoney" field should increase in the header.

I could do it with a query but i was wondering if there was a more elegant way?

Kind Regards,

Roemer80

Comments

roemer80’s picture

Title: Using a cck field in my header template » Using cck field data in my header template
markus_petrux’s picture

Status: Active » Fixed

CCK does not have an API that provides something like this, so you need to code something that builds the query.

The following should give you the information that you need to query CCK fields, but you need to build the query itself.

// Obtain information about a field attached to a node type.
$field = content_fields('field_name', 'node_type');

// Obtain database information about the field.
$db_info = content_database_info($field);

// $db_info['table'] contains the name of the table where the field is stored.

// $db_info['columns'] contains information about the database columns of the field.
roemer80’s picture

Thank you so much for the quick reply! I will struggle a bit with query's and publish them here. Again thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.