Theming a Plugin in Croogo 3.05

Visto 32 veces
Saltar al primer mensaje no leído

Frisches Deo

no leída,
6 dic 2018, 8:11:516/12/18
a Croogo
Hi guys,

thank you for your work so far. I'm using Croogo 3.05 and want to extend it features. I've created a theme (which wasn't that easy, as every documentation i can find is made vor earlier Versions of the CMS) which i want to use in my plugin i'm creating right now. The Plugin is going to be a simple Backend Module with CRUD functionality and display in the frontend.
I'm stuck at how i can achieve to use my theme i created inside the views of my plugin? The CakePHP Documentation says

  // For CakePHP before 3.1
    public $theme = 'Modern';

    public function beforeRender(\Cake\Event\Event $event)
    {
        $this->viewBuilder()->setTheme('Modern');

        // For CakePHP before 3.5
        $this->viewBuilder()->theme('Modern');
    }

But how can i declare my plugin to use the theme i created and activated in the Backend of Croogo?

Thank you and Best Regards

Jérôme BUTRYN

no leída,
6 dic 2018, 12:47:316/12/18
a Croogo
Hi

For the Frontend, use default theming system of Croogo
For you custom backend, you can set layout with a prefix in your plugin Controller for example :

class MyPluginAppController extends AppController
{
  public function beforeFilter()
    {
    if (!isset($this->request->params['admin']) && isset($this->request->params['manage'])) {
        $this->layout = 'MyPlugin.my_custom_layout_name';
    }
    ....
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos