Theme example or documentation for Croogo 3.x

180 views
Skip to first unread message

Toni Jaumar

unread,
Mar 1, 2018, 9:13:53 AM3/1/18
to Croogo
Hello,

I need to develop a custome theme for a web made with croogo 3.x. 
I've been searching but I can not find any theme that I can download or documentation wich would serves me as an example to develop mine.
I would greatly appreciate if someone could tell me where to find an example.
Thank you very much
Toni

Rachman Chavik

unread,
Mar 2, 2018, 7:56:19 PM3/2/18
to Croogo


Since croogo 3.x is based on cakephp 3.x, a theme is basically a cakephp plugin.

The easiest way to get started is to run the following in your croogo ROOT dir:

- create a new plugin called MyTheme in ROOT/plugins/MyTheme

  $ bin/cake bake plugin MyTheme

- create file plugins/MyTheme/config/theme.json
  use https://github.com/croogo/croogo/blob/master/Core/config/theme.json as example

- create your template layouts, elements as needed.  it follows standard cakephp directory layouts.

  eg: create plugins/MyTheme/src/Template/Layout/default.ctp with the following content: <?= $this->fetch('content') ?>

- Activate MyTheme

  $ bin/cake ext activate theme MyTheme

  When access via browser, it should use the newly created layout

- Override other Croogo views, eg Croogo/Nodes promoted.layout by creating the following file:

  plugins/MyTheme/src/Template/Plugin/Croogo/Nodes/Nodes/promoted.ctp

  and populating it as needed.


Hope it helps


 
Message has been deleted
Message has been deleted
Message has been deleted

Toni Jaumar

unread,
Mar 18, 2018, 12:21:12 PM3/18/18
to Croogo
Thanks for your detailed answer, it has been very useful for me.

I did it as you told me but fot the activation I changed the register 'Site.theme' in the settings table of database (from 'Croogo/Core' to 'MyTheme').

Frontend works ok (it renders MyTheme), but in the backend "Extensions > Themes" the new theme it's showed as inactive. And button 'Activate' and 'Delete' dosn't work. I compressed in zip the whole plugin and tryed to upload it and it dosn't worked too. 

Do you know what I need to do to make the theme uploable and activable? Thanks in advance!!! ;-) 

I attach the theme plugin in a ZIP (essentially it is a croogo base theme copy: default.ctp layout and webroot folder). Hope It will be useful as a start point to anyone who need to make his own theme.

When I will have full working theme package I will share it. I feel that Croogo is a nice tool and more people would use it if there was themes and plugins available.

Thanks for your time ;-)

Toni
Message has been deleted
Message has been deleted
Message has been deleted

Toni Jaumar

unread,
Mar 18, 2018, 12:31:51 PM3/18/18
to Croogo
Hi again Rachman,

As Google Groups doesn't allows me to attach a file to the response I will send you a private message with my email.

If you want I cand send you the theme and I think It would be nice to share it in GitHub to improve-it and share it with de community.

Thanks

Toni
Reply all
Reply to author
Forward
0 new messages