regionhalland/region-halland-plugin-parent-category

获取当前类别的父类别

v1.1.0 2020-05-27 14:38 UTC

This package is auto-updated.

Last update: 2024-09-28 00:10:47 UTC


README

如何使用Region Halland的插件"RhParentCategory"

以下是如何使用插件"RhParentCategory"的说明。

使用范围

此插件设置最后访问的页面

许可模型

此插件使用GPL-3.0许可模型。您可以通过附带的文件了解更多关于此许可模型的信息

LICENSE (https://regionhalland.visualstudio.com/public.RhWpPlugIns/_git/RhParentCategory?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/RhParentCategory

通过composer导入插件

这两个部分需要您添加到您的composer文件中

Repositories = 存储插件的位置,在本例中为github

"repositories": [
  {
    "type": "vcs",
    "url": "https://regionhalland.visualstudio.com/public.RhWpPlugIns/_git/RhParentCategory"
  },
],

Require = 指定您想使用的插件版本,在本例中为版本1.0.0

注意!请确保您下载的是最新版本。

"require": {
  "regionhalland/region-halland-plugin-parent-category": "1.0.0"
},

通过"Blade"显示父类别

@php($myParentPage = get_region_halland_parent_category())
@if($myParentPage['has_back'] == 1)
  <div>
    <p>
      <a href="{{$myParentPage['url']}}">{{$myParentPage['post_title']}}</a>
    </p>
  </div>
@endif

数组示例

array (size=3)
  'post_title' => string 'Kategori 1' (length=10)
  'url' => string 'http://dev-intra.local/category/kategori-1/' (length=43)
  'has_back' => int 1

版本历史

1.1.0

  • 添加了通过Packagist发布的功能

1.0.0

  • 第一个版本