simplepleb / themes
主题允许你在Laravel应用程序中创建和切换主题。
v1.63
2022-04-21 12:41 UTC
Requires
- php: >=7.2.0
- opis/closure: ^3.5@dev
Requires (Dev)
- illuminate/support: >=5.0.1
Suggests
- 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/thememanager-module: Manage themes for front-facing and admin panels
README
简化Laravel应用程序(前端)的主题化。
可以为您设计独特(定制)的主题。通过下面的XSCode横幅联系我开始。
安装
composer require simplepleb/themes
使用 artisan CLI 发布配置和工作主题。
php artisan vendor:publish --provider="SimplePleb\Theme\ThemeServiceProvider"
在更新包之前
在运行 composer update 之前,如果您编辑了任何包含的主题,
- 复制编辑的主题文件夹
- 在新文件夹中更新 theme.json 文件(主题名称和缩写)。
这样做是为了避免更新覆盖您对模块包所做的任何更改。
包更新后:发布主题库进行更新
php artisan vendor:publish --tag=themes
从控制器方法使用
// themes included with package hustbee, oreo, more coming Theme::uses('hustbee'); // change to the name of your theme $data['info'] = 'Hello World'; return Theme::view('index', $data);
设置
每个主题都可以通过在主题文件夹中添加文件 custom_fields.json 来为Laravel添加自定义设置。这些字段在Laravel中生成完整的设置表单。
{
"fields": [
{ "field_name": "home_title", "field_type": "textbox", "field_options": "", "field_help": "", "field_value": "Welcome Home"},
{ "field_name": "footer_text", "field_type": "textarea", "field_options": "", "field_help": "Placed on the bottom of every page", "field_value": "Thanks for visiting"},
{ "field_name": "home_intro", "field_type": "wysiwyg", "field_options": "", "field_help": "", "field_value": "<h1>Thanks for visiting</h1>"},
{ "field_name": "enable_customizer", "field_type": "checkbox", "field_options": "", "field_help": "Show style customizer", "field_value": "Thanks for visiting"},
{ "field_name": "test_select", "field_type": "select2", "field_options": "White,Yellow,Black", "field_help": "Tests the select", "field_value": "White"}
]
}
自定义菜单
主题可以通过在文件 custom_fields.json 中添加菜单,使页脚或其他 <ul> 列表易于修改。
"menus": [ { "menu_name": "hustbee_footer_1", "menu_class": "", "links": [ { "title": "About Us", "url": "/about_us", "li_class": "", "link_class": "", "parent": 0, "order": 0 }, { "title": "Press & Media", "url": "/press-media", "li_class": "", "link_class": "", "parent": 0, "order": 0 }, { "title": "News & Blog", "url": "/blog", "li_class": "", "link_class": "", "parent": 0, "order": 0 } , { "title": "Contact Us", "url": "/contact-us", "li_class": "", "link_class": "", "parent": 0, "order": 0 }, { "title": "Careers", "url": "/careers", "li_class": "", "link_class": "", "parent": 0, "order": 0 } ] }, { "menu_name": "hustbee_footer_2", "menu_class": "nav navbar-nav navbar-nav-centered", "links": [ { "title": "About Us", "url": "/about_us", "li_class": "nav-item", "link_class": "nav-link", "parent": 0, "order": 0 }, { "title": "Press & Media", "url": "/press-media", "li_class": "nav-item", "link_class": "nav-link", "parent": 0, "order": 0 } ] } ]
查看具有这些功能启用的主题 'hustbee' 的完整示例。为了更容易地管理菜单并使其易于编辑和管理,请查看 Menu Maker Module。
示例主题的截图
Oreo
Digincy
Hustbee



