regionhalland / region-halland-plugin-current-category
设置和获取当前分类
v1.3.0
2020-05-28 15:32 UTC
This package is auto-updated.
Last update: 2024-09-29 01:27:54 UTC
README
如何使用Region Halland的插件"RhCurrentCategory"
以下是如何使用"RhCurrentCategory"插件的说明。
应用范围
此插件设置和获取当前分类周围的会话变量
许可证模型
此插件使用许可证模型GPL-3.0。您可以通过随附的文件了解更多关于此许可证模型的信息
LICENSE (https://regionhalland.visualstudio.com/public.RhWpPlugIns/_git/RhCurrentCategory?path=%2FLICENSE&version=GBmaster)
安装和激活
A) Hämta pluginen via Git eller läs in det med Composer
B) Installera Region Hallands plugin i Wordpress plugin folder
C) Aktivera pluginet inifrån Wordpress admin
通过Git获取插件
git https://regionhalland.visualstudio.com/public.RhWpPlugIns/_git/RhCurrentCategory
通过composer导入插件
这两个部分需要添加到您的composer文件中
Repositories = 插件存储的位置,在本例中为github
"repositories": [
{
"type": "vcs",
"url": "https://regionhalland.visualstudio.com/public.RhWpPlugIns/_git/RhCurrentCategory"
},
],
Require = 指定要使用的插件版本,在本例中为1.0.0
注意!请确保您获取的是最新版本。
"require": {
"regionhalland/region-halland-plugin-current-category": "1.0.0"
},
包含设置当前分类的功能
注意!创建一个app-category.blade.php,并使用该布局代替category.blade.php
<body)>
@php(set_region_halland_current_category_session())
osv...
</body)>
获取当前分类并在分类页面上显示
@php($myCategory = get_region_halland_current_category_name())
<h1>
{{ $myCategory['title'] }}
</h1>
@if($myCategory['description'] > 0)
<span>
{!! $myCategory['content'] !!}
</span>
@endif
版本历史
1.3.0
- 添加了一个posttype,以便将Gutenberg添加到分类中
- 此posttype随后在分类页面上显示
1.2.0
- 添加了通过Packagist发布的pipeline
1.1.0
- 调整了函数名称
1.0.0
- 第一个版本