bahsite Posted March 6, 2020 Report Share Posted March 6, 2020 Hi, I was trying to figure out how to create custom plugin views without success. The only way I found to edit plugin templates is hardcoding core plugin views files at /plugins/plugin_name/views/default/ Is there any way to create my own custom views at /plugins/plugin_name/views/custom_theme/ ? Thanks for your support Quote Link to comment Share on other sites More sharing options...
0 Tyson Posted March 6, 2020 Report Share Posted March 6, 2020 In your controller, probably the parent controller, set the custom view directory in preAction: $dir = 'custom_theme'; $this->view->view = $dir; $this->structure->view = $dir; Quote Link to comment Share on other sites More sharing options...
0 bahsite Posted March 7, 2020 Author Report Share Posted March 7, 2020 8 hours ago, Tyson said: In your controller, probably the parent controller, set the custom view directory in preAction: $dir = 'custom_theme'; $this->view->view = $dir; $this->structure->view = $dir; Thanks for your answer, Tyson. I forgot to say I'm not a coder. I can read PHP but I'm lost dealing with object oriented programming. Please, could you tell me where to paste that simple code? Quote Link to comment Share on other sites More sharing options...
0 Jono Posted March 9, 2020 Report Share Posted March 9, 2020 So plugins will usually have a parent controller that their other controllers inherit from that has a name in the format my_plugin_controller.php In that file/class there should be a method called preAction and you should add that code at the end of that method. Quote Link to comment Share on other sites More sharing options...
Question
bahsite
Hi,
I was trying to figure out how to create custom plugin views without success.
The only way I found to edit plugin templates is hardcoding core plugin views files at /plugins/plugin_name/views/default/
Is there any way to create my own custom views at /plugins/plugin_name/views/custom_theme/ ?
Thanks for your support
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.