【发布时间】:2016-02-15 18:36:45
【问题描述】:
我正在使用 Unclecheese 仪表板模块。现在我正在尝试重载(? I think that's the right englisch term) Dashboard_Content.ss 模板。为此,我将其内容复制到模块目录下“包含”文件夹中的同名新文件中。进行更改并保存。
刷新后没有任何反应,但是如果我将相同的模板文件放在 mysite/templates/Includes 而不是 mymodule/templates/Includes 下,它会按预期工作......
即使我从仪表板文件夹中删除原始模板文件,我的模块文件夹中的文件也无法识别。
我的下一个尝试是扩展仪表板并使用另一个模板进行渲染
<?php
class CSYMDashboardExtension extends DataExtension {
public function init() {
$config = SiteConfig::current_site_config();
if(!$config->CompanyID || !$config->CompanyOwner || !$config->Bank || !$config->IBAN || !$config->BIC || !$config->UstID || !$config->SenderEmail) {
return $this->owner
->customise(
['Message' => 'Die Einrichtung ist noch nicht komplett abgeschlossen! Wird das System in diesem Zustand verwendet werden Fehler auftreten! Bitte setzen Sie die Einrichtung hier fort <a href="/admin/settings/">Einstellungen</a>']
)->renderWith(['DCTest']);
}
}
}
但这不起作用,无论模板文件位于何处(我也尝试过onAfterInit()。
在我的模块 config.yml 中,我声明它在框架和 cms After: 'framework/*','cms/*' 之后加载
有人有解决这个问题的办法吗?
编辑: 附带说明一下,我在重载 UploadField_FileButtons.ss 模板时遇到了类似的问题。在我将“包含”文件夹更改为“包含”之前,这也未被识别。但是对于仪表板案例,它不能双向工作。
【问题讨论】:
标签: silverstripe