站点管理(多站安装&多语言&站群&模板切换)


安装后,可以添加多个域名,选择不同的模板,即可实现简单的多站或站群功能。(仅支持thinkcmf 5.1,如有问题请联系我)

站点管理(多站安装&域名网站)

站点管理(多站安装&域名网站)

添加站点功能

站点管理(多站安装&域名网站)

这是一个经过华丽包装的切换插件i_f30.gif




关于【企业门户解决方案】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

BrowserPreview_tmp.jpg

ThinkCMF模板插件交流群:550851374 ,领取阿里云1000通用代金券

评论

暂时关闭,稍后恢复~
文档请看10遍以上!有问题可加QQ群!
发布插件

七牛专享优惠码

507670e8

ThinkCMF教程


ThinkCMF 8.0.1发布啦!节日快乐! 立即体验!