2011-08-20 4 views
0

D6에서이 작업을 수행하는 방법에 대한 수많은 자습서를 찾았습니다. 찾은 예제 코드는 오메가 하위 분류에서 작동하지 않습니다. Here's 코드 I've 오메가 하위 테마가있는 Drupal 6의 테마 사용자 등록 페이지

은 나에게 맞는 발견 ( via Trellon) 최고 :

template.tpl.php 내부 :

<?php 
function themename_theme($existing, $type, $theme, $path) { 
    return array(
    ... 
    // tell Drupal what template to use for the user register form 
    'user_register' => array(
     'arguments' => array('form' => NULL), 
     'template' => 'user-register', // this is the name of the template 
    ), 
    ... 
); 
} 
?> 

그리고 사용자 register.tpl을 here's. PHP 양식 :

<div id="registration_form"> 
    <div class="field"> 
    <?php 
     print drupal_render($form['account']['name']); // prints the username field 
    ?> 
    </div> 
    <div class="field"> 
    <?php 
     print drupal_render($form['account']['pass']); // print the password field 
    ?> 
    </div> 
    <div class="field"> 
    <?php 
     print drupal_render($form['submit']); // print the submit button 
     ?> 
    </div> 
    </div> 
</div> 

것은 내 template.tpl.php 파일 내부에 I've 이미 mytheme_theme 선언이다, 그래서 나는 새로운 코드를 추가하는 방법을 알고하지는. 내 오메가 subtheme 폴더 내부

: 사실

/** 
* Implementation of HOOK_theme(). 
*/ 
function lcph_theme(&$existing, $type, $theme, $path) { 
    $hooks = omega_theme($existing, $type, $theme, $path); 
    // Add your theme hooks like this: 
    /* 
    $hooks['hook_name_here'] = array(// Details go here); 
    */ 
    // @TODO: Needs detailed comments. Patches welcome! 
    return $hooks; 

} 

, 난 그냥/내 템플릿 파일 내부 코드를 붙여 복사 할 경우,이 I've가있어 오류입니다 :

Fatal error: Cannot redeclare lcph_theme() (previously declared in /sites/all/themes/lcph/template.php:22) in /sites/all/themes/lcph/template.php on line 125 

방법은 내 오메가 하위 주제 템플릿에 예제 코드를 추가 할 수 있습니까? 지도와 도움에 감사드립니다. 당신이 다음을 수정 ... 당신이 다음 그것을 발견하지 않은 경우가 발견되면 당신이 omega_theme() 함수에 대한 귀하의 template.php 파일에서 검색되지 않는

는 Rosamunda는

답변

1

파일을 template.php 어떤 일을 추가 해달라고 ur 자신의 하나를 만들 ...... 나는 정확하게 이해하지만 어쩌면 다음 단계는 당신을 도울 수

012 템플릿을 검색합니다. 당신은 template.php 파일 검색 * 테마 폴더에 template.php 파일에서 urthemename_theme() 함수를 2 번 검색 * 발견하면 수정할 수 있습니다. ur 고유 한 함수를 만들 수없는 경우u는 그 다음 당신의 자신의 경로를 만들고 그 안에 다음 코드를 넣어 발견하지 않은 경우 UR 테마 파일에서 user_register.tpl.php 파일에 대해 다음

function omega_theme($existing, $type, $theme, $path) { 
    return array(
    'user_register' => array(
     'arguments' => array('form' => NULL), 
     'template' => 'user-register', // this is the name of the template 
    ), 
); 
} 

3 검색 등 6,...

난 당신이 template.tpl.php 파일이 무슨 뜻인지 잘 모릅니다
<div id="registration_form"> 
    <div class="field"> 
    <?php 
     print drupal_render($form['account']['name']); // prints the username field 
    ?> 
    </div> 
    <div class="field"> 
    <?php 
     print drupal_render($form['account']['pass']); // print the password field 
    ?> 
    </div> 
    <div class="field"> 
    <?php 
     print drupal_render($form['submit']); // print the submit button 
     ?> 
    </div> 
    </div> 
</div> 

는 ... 난 당신이 template.php 내가 그 도움을 희망 의미 생각