I have a component that has a view. The problem I'm having is that the view for the component is being rendered before the template, and then the template is overwriting it.

I can put debugging in and see that the component's controller and view are being correctly loaded, but then when I put debugging in the template after that, the html that was part of the component are gone. The template is starting over completely.

The result is that the template is loading empty, without the view that should be in it.

Why is this happening, and how can I get the view to render inside the template?


That sounds strange. Obviously, the template has the last say how an extensions output will be rendered. This is achieved by using override files which would be located in the folder /templates/your_template/html/your_component/your_viewname. However I doubt this is the issue in your case.

The question is how you generate your output. Usually a view uses a view layout file located in /components/your_component/your_viewname/tmpl/layout.php The view class (which extends JViewLegacy) then calls that using parent::display($tpl);. That call will then load the layout file and generate the output.

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.