Create custom pages and widgets and share them with your users. Take advantage of a wide range of editing options, including HTML and Markdown.
Since CustomPages version v1.0 external modules can provide own targets through the CustomPagesService.
/resources/templates/
.$allowUpdateDefaultTemplates
to true
./resources/templates/
.yii custom-pages/refresh-default-templates
.humhub\modules\custom_pages\modules\template\services\ImportService::EVENT_DEFAULT_TEMPLATES
and code in the file Events.php
:public static function onCustomPagesImportServiceDefaultTemplates(\humhub\modules\custom_pages\modules\template\events\DefaultTemplateEvent $event)
{
$event->addPath('@your-module-id/resources/custom-pages-templates');
}
Module.php
:public function enable()
{
parent::enable() && $this->importCustomPagesDefaultTemplates();
}
public function update() {
parent::update();
$this->importCustomPagesDefaultTemplates();
}
private function importCustomPagesDefaultTemplates(): bool {
$importServiceClassName = '\humhub\modules\custom_pages\modules\template\services\ImportService';
return !method_exists($importServiceClassName, 'importDefaultTemplates') ||
$importServiceClassName::instance()->importDefaultTemplates();
}