3

I want to call phtml file in left side bar in frontend.

My xml code is

    <reference name="root">
        <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
    </reference>
    <reference name="left">
        <block type="theaterbooking/theaterbooking" name="theaterbooking" template="theaterbooking/movieinfo.phtml" />
    </reference>
    <reference name="content">
        <block type="theaterbooking/theaterbooking" name="theaterbooking" template="theaterbooking/movietheater.phtml" />
    </reference>

I call movieinfo.phtml but it is not called.

how can i do?

  • 1
    change the block names, because name must be unique – MeenakshiSundaram R Sep 1 '15 at 6:50
3
<default>
   <reference name="left">
     <block type="theaterbooking/theaterbooking" name="theaterbooking_movie" template="theaterbooking/movieinfo.phtml" />
   </reference>
</default>

Here i have changed the block name for unique name in current layout.Just change theaterbooking to theaterbooking_movie.

  • 2
    Hello Harry, Thanks for this answer. Your answer is obviously right. But it woul be more elegant if you can give some description about what went wrong here and how your code overcomes that. Thanks again. – Rajeev K Tomy Sep 1 '15 at 7:05
  • Its because of you used directive to <reference name ="left"> and check mine where i used a parent directive <default> and then inside that i have mentioned <reference> – Yogesh Trivedi Aug 5 '16 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.