2014-03-27 2 views
0

사용자 지정 콘텐츠 형식이라는 콘텐츠 형식을 만들었습니다. 콘텐츠 형식을 id.I 형식으로 재정의하려면 template.php와 custom-content-type-node-form에 bartik_theme을 포함 시켰습니다. 내 양식 ID와 내가 바틱의 템플릿에 사용자 정의 콘텐츠 유형 노드 form.tpl.php를 만들었습니다.하지만 override.Iut 수 없습니다. 또한 dpm() 함수를 사용하여 노력하지 않는 배열 구조를 인쇄하려고합니다. 감사합니다 당신은 사전에 ...콘텐츠 형식이 drupal7에서 재정의되지 않습니다.

 I included this in template.php 

     function bartik_theme() { 
     return array(
      'custom_content_type_node_form' => array(
      'arguments' => array('form' => NULL), 
      'template' => 'templates/custom-content-type-node-form', 
      'render element' => 'form' 
      ), 
      ); 
      } 

     I created custom-content-type-node-form.tpl.php in template folder 

      <?php 
       dpm($form); 

        hide($form['body']); 

       print drupal_render_children($form['field_custom_image']); 
        print drupal_render_children($form['title']); 

        print drupal_render_children($form); 
        ?> 
+0

drupal 제안을 살펴보십시오. hook_theme을 모두 구현하지 않아도됩니다. https://drupal.org/node/1089656 –

답변

0

그것은 당신의 커스텀 테마 구현이 테마 후크 제안 배열에 없기 때문입니다. "template_preprocess_page"후크 사용은 후크 제안 배열에 제안을 추가 :

function yourtheme_preprocess_page(&$vars) { 
//your checks here ... 
$vars['theme_hook_suggestions'][] = 'custom_content_type_node_form'; 
//... 
} 

을하지만 당신은 내가 "hook_form_alter"또는 "hook_form_FORM_ID_alter"후크를 사용하는 것이 좋습니다 양식 요소를 변경하려는 경우.

관련 문제