I have a page with a block showing a list of items at a route /item-list. How can I set a block controller to render separate views (view.php) and use their own assets view.css and view.js on the same page based on an action? e.g.
/item-list will use the block’s view.php, view.css and view.js (no action, simply view())
/item-list/item/123 same controller but render different view.php, view.css and view.js (action_item())
I tried rendering from a templates/view.php - it renders the view but uses the default view.css/js, not those in the templates folder.
@Myq Yes, both controllers have the same action. I couldn’t find any better way but to swap block render based on action. Now the problem is I can’t get the page’s action and parameter, because controller->getAction() doesn’t return anything.