cck

Using Node References on a Multilingual Website

CCK Node Reference is an excellent module that allows creation of complex relationships between content types in Drupal. Combine that with Views2 feature called Relationships and you have one of the most sophisticated information architecture design tools any CMS has ever seen. At least - if you stick to one language. When you are working on a multilingual website, though, things get complicated. In this blog post we will discuss how to properly configure node references on a multilingual Drupal website.

CCK Import During Install

We've blogged about hardcore Drupal Form Manipulations using CCK Node Types and hooks. If it is part of your module (as it should) you need to install CCK type during module setup. In the .install file of that module you can import CCK definition with a code like:

function ourmodule_CCK_install() {

	$modulepath = drupal_get_path ('module', 'ourmodule');	
	$cck_definition_file = $modulepath."/custom.cck";

  $values['type_name'] = '<create>';
  $values['macro'] = file_get_contents($cck_definition_file);
  
  include_once( drupal_get_path('module', 'node') .'/content_types.inc');
  include_once( drupal_get_path('module', 'content') .'/content_admin.inc');
  
  drupal_execute("content_copy_import_form", $values); 
}

where custom.cck under your module folder is the file that you can export from CCK if you have cck_content_copy module installed.

Syndicate content