Blog

Posted by: 
Dominique De Cooman

By big imports I mean creating millions of nodes and indexing them fo apache solr search. We needed to import 1 million records from file, 3 nodes for each record, one in each of our 3 languages. These nodes also had 3 taxonomy vocabularies, around 30 cck fields and we also needed to join another table containing a spatial coordinates for our geo field.

Posted by: 
Dominique De Cooman

This post presents the drupal multilingual variables list so far:

Only core and core module module multilingual variables are included.

<?php
$conf
['i18n_variables'] = array(   
  
'site_name',
  
'site_footer',
  
'site_slogan',
  
'site_mission',
  
'anonymous',
  
'theme_settings',
  
'theme_garland_settings',
  
'site_frontpage',
  
'menu_primary_links_source',?>

Posted by: 
Dominique De Cooman

How to update translations with drupal? The core only imports translations when you enable the language. It does not support updating languages.

We all know how to import language translations in the first place. We go to http://drupal.org/project/Translations and pick our translation and we copy the files onto our drupal core.

Posted by: 
Dominique De Cooman
It is now possible to configure your taxonomy autocomplete widgets to match anything in search strings or to match them from the beginning. http://dominiquedecooman.com/contribtion/taxonomy-autocomplete-settings.
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
/**?>

Pages

Subscribe to Blog