Create new views

More
3 years 2 months ago #150294 by Cufe
Create new views was created by Cufe
Hello, I want to create 2 new views in frontend (maybe layout):
a) for category
b) for detail of item (event)

In component is not classic MVC for override now = exist only different layouts - default, table, timeline, columns. And i wanto to create more differrent layouts/views e.g. layout/view #1 for category A and layout/view #2 for category B (of default layout). And e.g. layout/view #3 for category C and layout/view #4 for category D (of table layout).

I want to solve the same problem for the event item preview detail == other layout/view.

Please, how to do it?

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #150301 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Create new views
Hello

Here are the steps:

- Copy the file components/com_eventbooking/view/category/tmpl/default.xml, change it to something else like custom.xml
- Copy the file default.php, change it to custom.php (or any name you want)
- Copy events_default_layout.php, change it to events_custom_layout.php

Modify code. Then you should be able to create a menu item to link to category view using that new layout

Tuan

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #150302 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Create new views
Or I wonder why don't you override one of existing layouts ? There are 4 layout options for category already, so it should be enough. Just override these existing layouts and change it to look like the way you want instead of creating new view/layout

Tuan

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #150307 by Cufe
Replied by Cufe on topic Create new views
Thank you! Do I have to move the xml file to the override folder (template / html / ....)?

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #150308 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Create new views
No, just leave it there

Please Log in or Create an account to join the conversation.