Temas
v4Temas controlam a aparência do site. Layouts, componentes e páginas públicas ficam emthemes/{nome}/. Módulos guardam a lógica; temas guardam o visual.
Tema ativo
Definido em config/system.php:
// config/system.php
return [
'theme' => 'default',
// ...
];Se o tema configurado não existir, o sistema usa default como fallback.
Estrutura de um tema
themes/default/
├── _layouts/
│ └── app.mucrm.php
├── _components/
│ ├── card.mucrm.php
│ └── web/
│ ├── navigation.mucrm.php
│ ├── title.mucrm.php
│ └── sidebar-left.mucrm.php
├── home.mucrm.php
├── assets/
│ └── css/style.css
└── modules/ # Sobrescreve views de módulos
└── shop/
└── views/Como o handler usa o tema
protected string $layout = '_layouts.app';
return $this->view('home', $data)->title('Início');
// → themes/default/_layouts/app.mucrm.php + themes/default/home.mucrm.phpTemas no projeto
| themes/default/ | Site público |
| themes/panels/admin/ | Painel administrativo |
| themes/mails/ | Templates de e-mail |
| themes/gates/ | Páginas de gate/landing |
Assets do tema
// CSS do tema ativo:
<link rel="stylesheet" href="<?= e(theme_src('css/style.css')) ?>">theme_src() aponta para themes/{tema}/assets/.
Sobrescrever views de módulos
Para personalizar a tela de um módulo sem alterar o código dele, crie a view no tema:
themes/default/modules/shop/views/shopping.mucrm.php
// ↑ Tem prioridade sobre app/modules/shop/views/shopping.mucrm.phpCriar um tema novo
- Copie
themes/default/parathemes/meu_tema/ - Altere
_layouts, CSS e_components - Configure
'theme' => 'meu_tema'emconfig/system.php