이미 내 drupal 프로젝트에 콘텐츠 유형이 있습니다.drupal 7 콘텐츠 유형을 자동으로 코드로 변환하십시오. 콘텐츠 형식 생성기 코드?
현재 내 자신의 모듈로 작업하고 있으며 내장 된 콘텐츠 형식을 만들고 싶습니다. Drupal에서 직접 작성한 컨텐트 유형을 코드로 변환하는 방법이 있습니까? 일종의 콘텐츠 유형 코드 생성기?
가능한 경우 자동으로이 코드를 생성하고 싶습니다.
$t = get_t();
// Define the node type.
$slider = array(
'type' => 'slider',
'name' => $t('Slider Content'),
'base' => 'node_content',
'description' => $t('This is an example node type with a few fields.'),
'body_label' => $t('Example Description')
);
// Complete the node type definition by setting any defaults not explicitly
// declared above.
// http://api.drupal.org/api/function/node_type_set_defaults/7
$content_type = node_type_set_defaults($slider);
node_add_body_field($content_type);
// Save the content type
node_type_save($content_type);
고마워요.
고마워, 내가 필요한 것 : –