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 can I create programmatic content type and cck fields with module ?

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, get with : menu path Administer -> Content management -> Content types -> Export) – planning.module (<?php) – planning.install : with php code :


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

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

Commenting on this Drupal Question is closed.