安装后,可以添加多个域名,选择不同的模板,即可实现简单的多站或站群功能。(仅支持thinkcmf 5.1,如有问题请联系我)
添加站点功能
这是一个经过华丽包装的切换插件
关于【企业门户解决方案】cms的设置问题。
如没有安装,请点击下方链接安装
码云:https://gitee.com/thinkcmf/portal
GitHub:https://github.com/thinkcmf/portal
ps:如果在后台的门户应用分类和文章中需要选择到对应站点的模板,需要修改一个文件
app/admin/model/ThemeModel.php
(上面没有,或者在这里vendor/thinkcmf/cmf-app/src/admin/model/ThemeModel.php)
原来的代码如下
/** * 获取当前前台模板某操作下的模板文件 * @param $action string 控制器操作 * @return array|string|\think\Collection * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function getActionThemeFiles($action) { $theme = config('template.cmf_default_theme'); return Db::name('theme_file')->where(['theme' => $theme, 'action' => $action])->select(); }
修改成如下↓↓↓
/** * 获取当前前台模板某操作下的模板文件 * @param $action string 控制器操作 * @return array|string|\think\Collection * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function getActionThemeFiles($action) { $hookTheme = hook_one('switch_theme'); if ($hookTheme) { $theme = $hookTheme; }else{ $theme = config('template.cmf_default_theme'); } return Db::name('theme_file')->where(['theme' => $theme, 'action' => $action])->select(); }
-----------------------------------------------华丽的Tips分割线--------------------------------------------
多模板的【文章管理】分类的后台菜单可以这样设置,如下图下,方法中填入文章分类参数【index?category=1】。
相关文章https://www.thinkcmf.com/topic/10062.html
ThinkCMF模板插件交流群:550851374 ,领取阿里云1000通用代金券