simplepleb / thememanager-module
用于管理前后端Laravel网站主题
v1.64
2022-04-21 12:39 UTC
Requires
- php: ^8.0
- nwidart/laravel-modules: ^9.0
- simplepleb/themes: ~1.6
Suggests
- joshbrw/laravel-module-installer: Makes installing and updating modules simple
- simplepleb/article-module: Complete article post and category module
- simplepleb/comment-module: Add comments to site content
- simplepleb/content-module: Manage site content and front-facing pages
- simplepleb/menumaker-module: Build dynamic menus for your front and back end
- simplepleb/modulemanager-module: Manage modules easily
- simplepleb/tag-module: Add tags and taggables to content
- simplepleb/themes: A library of starter themes for your laravel project
- spatie/laravel-permission: To be able to set access by role and permissions
README
Laravel CMS的模板管理(前端)。
仪表板
使用主题管理仪表板,您可以点击更改网站的主题。主题将显示截图、描述和相关信息。通过点击“激活”,您的网站(前端)主题将更新为所选主题。
如果您选择禁用主题,通过在仪表板中点击“禁用”按钮,如果存在,您的网站将仅显示默认的Laravel登录页面。
安装
composer require simplepleb/thememanager-module
安装后
发布自定义blade组件。以下命令将文件复制到文件夹 resources/views/components/buttons
php artisan vendor:publish --tag=theme-manager
主题视图
主题文件夹包含json文件,使得从控制器方法中使用正确的视图变得容易。查看任何主题文件夹中的 pages.json
以获得更好的理解。
简单预览
预览任何主题视图页面非常简单。在浏览器中打开 /thememanager/preview/{VIEW_PAGE}/{THEME_NAME}
。VIEW_PAGE
值是要预览的blade模板文件的名称。THEME_NAME
(可选)允许您轻松预览任何主题。如果没有指定 THEME_NAME
,则预览将使用默认主题。
截图
仪表板
设置
每个主题都可以有自己的设置 - 在 public/themes/{name}/custom_fields.json
文件中添加设置和默认值,这将构建设置表单,并允许最终用户修改主题中使用的变量和值。在您的主题blade文件和其他地方使用这些值。