Console commands
Caching
craft invalidate-tags/themes::blocks
: Clears all block cache (Pro)
craft invalidate-tags/themes::rules
: Clears rules cache
craft invalidate-tags/themes::displayers
: Clears displayers cache (Pro)
craft invalidate-tags/themes::eagerLoad
: Clears eager loading maps cache (Pro)
craft invalidate-tags/themes::templates
: Clears templates resolution cache (Pro)
craft themes/install
: Reinstall all themes data (layouts etc) (Pro)
Classes creation
Theme
craft themes/create/theme name [handle] [namespace] [className] [folder]
The handle, namespace and className will be made up if left empty. The folder will be taken from the configuration if left empty.
Example : craft themes/create/theme 'My Theme' my-theme 'Themes\MyTheme' MyBeautifulTheme themes
Block
craft themes/create/block theme name [handle] [description] [className]
This will create a class for a block and a class for the block options. The block class will be saved in the models/blocks
folder, and the options in the models/blockOptions
folder.
The handle and className will be made up if left empty.
Example : craft themes/create/block my-theme 'My Block' my-block 'This is a great block !' MyBlock
Note that the block will still need to be registered in the right provider.
Block provider
craft themes/create/block-provider theme name [handle] [className]
The handle and className will be made up if left empty.
Example : craft themes/create/block-provider my-theme 'My block Provider' MyBlockProvider
Note that the provider will still need to be registered on the service.
Field displayer
craft themes/create/field-displayer theme name [handle] [className]
This will create a class for a field displayer and a class for the options. The field displayer class will be saved in the models/fieldDisplayers
folder, and the options in the models/fieldDisplayerOptions
folder.
The handle and className will be made up if left empty.
Example : craft themes/create/field-displayer my-theme 'My Field Displayer' my-field-displayer MyFieldDisplayer
Not that the displayer will still need to be registered on the service.
File displayer
craft themes/create/file-displayer theme name [handle] [className]
This will create a class for a file displayer and a class for the options. The file displayer class will be saved in the models/fileDisplayers
folder, and the options in the models/fileDisplayerOptions
folder.
The handle and className will be made up if left empty.
Example : craft themes/create/file-displayer my-theme 'My File Displayer' my-file-displayer MyFileDisplayer
Not that the displayer will still need to be registered on the service.
Scss
craft clear-caches/themes-scss-cache
: Clear inline (templates) scss cache
craft themes/scss/compile theme srcFile destFile
: Compile a scss file