Multiple templates for the same view of a custom component

by dolma33   Last Updated August 17, 2018 15:10 PM

In my custom component, I would like to have multiple slightly different templates for the same view.

Something like

com_things/
...
 - views/
   - thing/
       ...
   - things/
     - tmpl/
         tabs.php
         accordion.php
         default.php
         default.xml
       view.html.php

In this example, the idea is that default template, accordion template and tabs template all use the data prepared in views/things/view.html.php, displaying it in slightly different ways.

The data should be displayed in the right template according to the url from which it's accessed, for example index.php?option=com_things&view=things&tmpl=tabs.

I've been playing with this for a while and looking for documentation, but I'm not being able to implement this feature. Shouldn't be enough to just create the tabs.php and accordion.php file, or am I missing something else?



Related Questions



How can include the component view in plugins

Updated July 06, 2015 13:04 PM

0 Class 'EngineeringHelpersEngineering' not found

Updated March 31, 2018 15:10 PM


Need some insight from developers

Updated February 19, 2016 01:04 AM