Magento Expert Forum - Improve your Magento experience

Results 1 to 3 of 3

How to recognize the phtml file from the layout xml file ?

  1. #1
    New member Kishore's Avatar
    Join Date
    Dec 2015
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to recognize the phtml file from the layout xml file ?

    I want to know the proper way of identifying a template file.
    For e.g.
    In my basket page (cart.phtml) there is a code like...
    PHP Code:
    echo $this->getChildHtml('shipping'); 
    I searched for the template for this as follows.....

    1. I checked "checkout.xml" file for the handle <checkout_cart_index>. And find where it is written "as='shipping'" and found that code as follows...
    <block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/>

    2. So I checked the "checkout/cart/shipping.phtml" file and try to modify it. But nothing happend. so i confirmed that it is not the right phtml file i am looking for.

    3. Then when I enable "Template Path Hints" from admin side , then came to know that it is coming from a different folder and it is due to the extension used. And in its layout file it is written as

    <checkout_cart_index>
    <reference name="checkout.cart">
    <block type="webshopapps_productmatrix/checkout_cart_shipping" name="checkout.cart.shipping" as="shipping" template="webshopapps/productmatrix/checkout/shipping.phtml"/>
    </reference>
    </checkout_cart_index>

    So My question is ,what is the proper way to know the template files which is used in our page as ChildHtml ?

    View more threads in the same category:


  2. #2
    Junior Member
    Join Date
    Jan 2016
    Location
    Miami, Florida
    Posts
    22
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Magento takes check folders with template files in the next order: the first place - theme from the package which is set in the admin panel, than it looks for template in the folder "default" in this package. If there is no such a file, then it should be in frontend/base/default/templates. Maybe you made a change in not right package or theme. Pls, check setting on the admin panel (system->configuration-> in tab-general click on design). Also keep attention on selected stores in the current configuration scope in the left up corner.

  3. #3
    Junior Member
    Join Date
    Sep 2018
    Location
    Oman, Muscat
    Posts
    2,084
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default

    The xml file and structure represented by two types of hierarchy of elements that name: The attribute which is used to identify a block. public_html/vendor/magento/module-search/view/frontend/templates/form.mini.phtml.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •