2013-04-03 2 views
1

저는 드루팔 (Drupal을 처음 접했고 인터넷상의 어느 곳에서나 이것에 대한 답을 찾을 수 없었습니다. 이 작품. 인쇄됩니다 무엇

<section id="content" class="span<?php print $content_cols ?>"> 
    <?php print render($page['content']) ?> 
    </section> 

이 괴물 같은 것입니다 : 내 페이지 템플릿 파일에서

, 나는 이런 식으로 뭔가를 볼

내가 $page['content']가 렌더링하는 방식을 편집 할
<section id="content" class="span9"> 
<div class="region region-content"> 
    <div id="block-system-main" class="block block-system"> 
    <div class="content"> 
     <div id="node-46" class="node node-article node-promoted clearfix" about="/node/46" typeof="sioc:Item foaf:Document"> 
     <div class="submitted"> 
      <span property="dc:date dc:created" content="2013-04-03T04:17:33+11:00" datatype="xsd:dateTime" rel="sioc:has_creator">Submitted by <a href="/user/1" title="View user profile." class="username" xml:lang="" about="/user/1" typeof="sioc:UserAccount" property="foaf:name">jimjo</a> on Wed, 04/03/2013 - 04:17</span> 
     </div> 
     <div class="content"> 
      <div class="field field-name-field-image field-type-image field-label-hidden"> 
      <div class="field-items"> 
       <div class="field-item even" rel="og:image rdfs:seeAlso" resource="http://localhost:8888/sites/default/files/styles/large/public/field/image/imagefield_q6bw6x.png?itok=RfIKEaZX"> 
       <img typeof="foaf:Image" src="http://localhost:8888/sites/default/files/styles/large/public/field/image/imagefield_q6bw6x.png?itok=RfIKEaZX" width="422" height="197" alt="Enim incassum letalis mauris neo praesent quia rusticus venio vero." title="Brevitas esse qui ratis volutpat ymo."> 
       </div> 
      </div> 
      </div> 
      <div class="field field-name-body field-type-text-with-summary field-label-hidden"> 
      <div class="field-items"> 
       <div class="field-item even" property="content:encoded"> 
       <p> 
        ARTICLE CONTENT GOES HERE 
       </p> 
       </div> 
      </div> 
      </div> 
     </div> 
     </div> 
    </div> 
    </div> 
</div> 
</section> 

, 그래서 클래스 이름에 대한 더 많은 제어권을 가질 수 있습니다. (아마도 불필요한 div를 제거 할 수도 있습니다.) 그러나, 나는이 출력을 제어하는 ​​방법을 이해할 수 없다.

이 작업을 수행하는 가장 좋은 방법은 무엇입니까? 사용자 정의 템플릿 파일을 사용합니까? Drupal이 $page['content']을 만드는 데 사용하는 마크 업을 어디에서 볼 수 있습니까? 그렇기 때문에 가이드로 사용하고 일부 변경을 할 수 있습니까?

답변

1

node.tpl.php 템플릿을 찾고있는 것 같습니다.

원래 node.tpl.php는 사용자가 설정 한 기본 테마에서 제공하는 것이 분명하지만 /modules/node/node.tpl.php에 있습니다.

사용자 지정 테마에 node.tpl.php을 만드는 것이 가장 좋은 방법입니다.

템플릿 재정의 원칙에 대해 더 자세히 알고 싶다면 Theme developer 모듈을 사용할 수 있습니다.

여기는 drupal.org documentation에 대한 링크입니다.