Blog

Posted by: 
Dominique De Cooman

The rules module is a very powerful module that allows you to make things react in your site when certain events happen (like a comment has been made) under certain conditions (for example when the user has role x).

A lot of events, conditions and actions are allready out of the box or provided by some contrib modules who have rules integration.

Posted by: 
Dominique De Cooman

How to submit some hidden values along with a drupal webform? Our example. We have job node (nid 1) and we want to go to a webform to apply for the job. So we build a link on our node pointing to the webform node (nid 2).
In the node template type quickly a url: node , nid webform, nid job node

<?php
print l('Apply for this job''node/2/1');
?>

Posted by: 
Dominique De Cooman

A cck fieldgroup can be rendered alone. We had some quicktabs we wanted to fill with our field groups. So we've builded a block for each field group to put in the quicktabs. Here is an example of one block where we called a single fieldgroup and rendered it.

Posted by: 
Dominique De Cooman

How to add another formatter to a cck field? A cck formatter is basically a theming function where the value of field is ran through. Formatters are available at "admin/content/node-type/[your node type]/display" in the cck interface.

Posted by: 
Dominique De Cooman

How to load only the content fields of a node to avoid a full node load?

Sometimes in scripts you need information stored in cck fields but you dont want to do full node loads neither do you want to query the table directly because setting a field from single to multiple value would make the table location of that field change.

Posted by: 
Dominique De Cooman

The standard way of altering form elements and setting them disabled does not work with cck fields.

<?php
function my_module_form_alter(&$form, &$form_state$form_id) {
  
$form['my_element']['#disabled'] = true
}
?>

The FAPI process handler of the CCK field won't transfer the #disabled attribute to its children elements.
You'll need this snippet to make it work.
<?php
/**?>

Posted by: 
Dominique De Cooman

The jquery scrollto is now available to drupal by using this project:

http://drupal.org/project/jquery_scrollto

For more on the jquery scroll to plugin http://plugins.jquery.com/project/ScrollTo

Posted by: 
Dominique De Cooman

This first project is used to make your interface localized easier. The second project is an API to look for translatable strings and translatability errors.
http://drupal.org/project/l10n_client
http://drupal.org/project/potx

Posted by: 
Dominique De Cooman
Posted by: 
Dominique De Cooman

The main function in drupal to format a date is the format_date function which will take the formatting and timezone conversion you configured at http://yoursite/admin/settings/date-time and http://yoursite/admin/settings/date-time/formats

<?php
//format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL)
//An example convert the unix timestamp for now 
?>

Pages

Subscribe to Blog