在SilverStripe 3中应用新主题时存在问题,只有“简单”主题有效,而不是任何主题。如果我尝试使用SilverStripe管理设置主题,主题会下拉到基本主题,并且不会对主题产生任何影响。我在_config.php中找不到SSViewer::set_theme()来设置主题。
发布于 2015-12-01 15:37:35
查看API docs或sourcecode,您会发现使用SSViewer::set_theme()已被弃用。
从SS3.1开始,您可以使用/mysite/_config/config.yml中的configuration api设置主题
---
Name: mysite
After:
- 'framework/*'
- 'cms/*'
---
# YAML configuration for SilverStripe
# See http://doc.silverstripe.org/framework/en/topics/configuration
# Caution: Indentation through two spaces, not tabs
SSViewer:
theme: 'mytheme'在yml文件中更改后,您必须调用?flush来重置所有配置缓存并使更改生效。
查看源代码,如果你在"SiteConfig“中设置了另一个主题,它应该会更新你的配置设置,至少对于ContentController的所有子类是这样的。
https://stackoverflow.com/questions/34013156
复制相似问题