I’d like to know if it’s possible to add an additional view override to my Joomla 2.5 Template without having to create an entirely new MCV model.
For example.
Currently I have an override for the categorylist. But I’d like to make another override for the categorylist and for that to work it’d need to be an available option in the backend aswel.
So I’d be able to choose between something like:
- categorylist
- categorylist-2
So say the override file is default.php, is it possible to add a default2.php and somehow make it available in the backend, or can I only do this by copying an entire com_content view and changing it so it’s a new MVC model?
I had never tried this before, but on testing it did get this to work in a way. I’m not sure if this is exactly what you are looking for, but it should help. With this method, you would be able to create a menu item that links to this view.
Say you were wanting to create a new category layout. You already have overridden the default layout in your template as such
templates/your-template/html/com_content/category/default.phpand now you want a second version.Make a copy of default.php and rename it default2.php. Then copy the default.xml file from
components/com_content/views/category/tmpl/default.xmltotemplates/your_template/html/com_content/category/default.xmland rename this to default2.xml.Open default2.xml and edit the title attribute of the layout tag at the top.
Go to the menu manager and add a new menu item and you should see your new title in the list!