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
  • 1
    change the block names, because name must be unique Sep 1, 2015 at 6:50

1 Answer 1

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
  • 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. Sep 1, 2015 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> Aug 5, 2016 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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