2010-06-28 2 views
0

나는 사용자 지정 콘텐츠 (cck 사용) 즉, thewittyshit을 가지고 있으며 field_thewittyshit이라는 필드가 있습니다. 모든 주제에 대해 field_thewittyshit 필드를 테마로하고 싶습니다. 다음 코드를 작성하여 새로운 파일, 즉 views-view-field - default - field-thewittyshit-value.tpl.php에 저장했습니다. 그러나 여전히 내보기 또는 노드 표시에 변경 사항이 반영되지 않습니다.Drupal-6의 필드 Theming a

<?php 
// $Id: views-view-field.tpl.php,v 1.1 2008/05/16 22:22:32 merlinofchaos Exp $ 
/** 
* This template is used to print a single field in a view. It is not 
* actually used in default Views, as this is registered as a theme 
* function which has better performance. For single overrides, the 
* template is perfectly okay. 
* 
* Variables available: 
* - $view: The view object 
* - $field: The field handler object that can process the input 
* - $row: The raw SQL result that can be used 
* - $output: The processed output that will normally be used. 
* 
* When fetching output from the $row, this construct should be used: 
* $data = $row->{$field->field_alias} 
* 
* The above will guarantee that you'll always get the correct data, 
* regardless of any changes in the aliasing that might happen if 
* the view is modified. 
*/ 
?> 
<em> 
<?php print $output; ?> 
<em/> 

텍스트 서식을 지정하고 싶습니다. 이 코드에서는 이탤릭체로 표시합니다.

답변

1

재정의하려는 템플릿은 테마 디렉토리에 있어야합니다. 보기 모듈 폴더에서 views-view-field.tpl.php 파일을 찾아 views-view-field--default--field-thewittyshit-value.tpl.php이있는 테마 디렉토리에 복사하여 붙여 넣으십시오. 그러면이 파일을 사용할 수 있습니다. 또한 캐시를 지운 후에 캐시를 지우십시오.

디버깅을 위해 여전히 문제가있는 경우보기가 views-view-field--default--field-thewittyshit-value.tpl.php인지 확인하십시오. 기본 설정 섹션의보기 UI에서 테마 옵션 옆의 '정보'를 클릭하십시오. 사용중인 테마는 굵게 표시됩니다.