Drupal Questions & Answers

Ask and answer Drupal related questions! No question too simple or complex!
SIO's picture
Asked by on Wed 23rd Nov 2011
How create programmatic content type and cck fields

Hi,
I’m trying to implement a module which created : content type and cck fields, named ‘planning’ but it’doesn’t work, somebody help me

I created 4 files :

- planning.info (contains dependencies) – planning.def.inc (contains definitions fields : menu path Administer -> Content management -> Content types -> Export) – planning.module (<?php) – planning.install : with php code :

<?php

function planning_install() {
install_include(array(‘content_copy’));
//create content type “planning” with cck fields”
$file = drupal_get_path(‘module’,‘planning’).”/planning.def.inc”;
install_content_copy_import_from_file($file);
}

When I install module ‘planning’, it doesn’t work
What is the problem
Thanks for your help

Commenting on this Drupal Question is closed.