2012-06-01 3 views
1

내 magento 템플릿에 다음과 같은 코드가 사용되었습니다. "getChildHtml ('content')"라는 코드가 내 홈페이지에 있습니다. 템플릿 파일에서 getChildHtml()을 사용하여 내용을로드하는 위치는 어디입니까?Magento 템플릿 디자인

답변

2

페이지 구조는 page.xml에서 찾을 수 있습니다.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>"> 
<head> 
<?php echo $this->getChildHtml('head') ?> 
</head> 
<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>> 
<?php echo $this->getChildHtml('after_body_start') ?> 
<div class="wrapper"> 
    <?php echo $this->getChildHtml('global_notices') ?> 
    <div class="page"> 
     <?php echo $this->getChildHtml('header') ?> 
     <div class="main-container col3-layout"> 
      <div class="main"> 
       <?php echo $this->getChildHtml('breadcrumbs') ?> 
       <div class="col-wrapper"> 
        <div class="col-main"> 
         <?php echo $this->getChildHtml('global_messages') ?> 
         <?php echo $this->getChildHtml('content') ?> 
        </div> 
        <div class="col-left sidebar"><?php echo $this->getChildHtml('left') ?></div> 
       </div> 
       <div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div> 
      </div> 
     </div> 
     <?php echo $this->getChildHtml('footer') ?> 
     <?php echo $this->getChildHtml('before_body_end') ?> 
    </div> 
</div> 
<?php echo $this->getAbsoluteFooter() ?> 
</body> 
</html> 

와 : 예를 들어, 당신은 당신이 당신이 볼 수있는이 PHTML을보고 그것으로 할 수 있습니다 디자인 테마의 템플릿 페이지/3columns.phtml에, 다음 3 colums

<default translate="label" module="page"> 
    <label>All Pages</label> 
    <block type="page/html" name="root" output="toHtml" template="page/3columns.phtml"> 
.... 

를 사용할 수 있는지 getChildHtml ('content')?>. 질문이 해결 되었습니까?

+0

예 내 문제는 코드의 도움으로 해결되었습니다. 감사합니다 – Maniprakash

+1

다른 질문이 하나 있습니다. Magento 컬렉션로드에서 Mage :: getModel()과 Mage :: getSingleton()의 차이점을 설명 할 수 있습니까? – Maniprakash

+0

이것은 Magento의 디자인 전문가입니다. Whit Mage :: getSingleton() 당신은 인스턴스 ob 객체가 유일하다는 것을 확신합니다. 예 : Mage :: getSingleton ('customer/session'). 당신은 원래 objet를 원한다. 실제로 세션을 불러올 때, Mage :: getModel()을 호출하면 새로운 Object가 호출된다. 그러나 새로운 질문을 던질 수 있습니다. 나는 대답 할 준비가되어있다 : P – davidselo