regionhalland/region-halland-plugin-category-pages

前端插件,用于获取与类别相关的页面

v1.2.0 2021-03-23 08:14 UTC

This package is auto-updated.

Last update: 2024-09-23 15:51:14 UTC


README

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

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

使用范围

此插件用于获取与类别相关的页面

许可证模型

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

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

通过composer导入插件

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

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

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

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

注意!请确保您获取的是最新版本。

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

通过"Blade"在页面上显示"导航路径"

@if(function_exists('get_region_halland_category_pages'))
  @php($myData = get_region_halland_category_pages())
    @foreach ($myData as $data)
      <div>
        <p class="rh-navigation-left__header-text">
          <strong>{{ $data['post_title'] }}</strong>
        </p>
      </div>
      <p>
        {{ $data['post_ingress'] }}
      </p>
      <p >
        <a href="{{ $data['post_url'] }}">Läs mer</a>
       <p>
  @endforeach
@endif

数组的示例

array (size=4)
  0 => 
    array (size=4)
      'ID' => int 157
      'post_url' => string 'http://dev-intra.local/sida-d/viktigt-om-coronavirus/' (length=53)
      'post_title' => string 'Viktigt om Coronavirus' (length=22)
      'post_ingress' => string 'Lorem ipsum dolor sit amet' (length=26)
      'post_content' => string 'Lorem ipsum...' (length=14)
  1 => 
    array (size=4)
      'ID' => int 112
      'post_url' => string 'http://dev-intra.local/sida-h/' (length=30)
      'post_ingress' => string 'Lorem ipsum dolor sit amet' (length=26)
      'post_content' => string 'Lorem ipsum...' (length=14)
  2 => 
    array (size=4)
      'ID' => int 109
      'post_url' => string 'http://dev-intra.local/sida-c/sida-c-1/' (length=39)
      'post_title' => string 'Sida C.1' (length=8)
      'post_ingress' => string 'Lorem ipsum dolor sit amet' (length=26)
      'post_content' => string 'Lorem ipsum...' (length=14)
  3 => 
    array (size=4)
      'ID' => int 114
      'post_url' => string 'http://dev-intra.local/sida-i/' (length=30)
      'post_title' => string 'Sida I' (length=6)
      'post_ingress' => string 'Lorem ipsum dolor sit amet' (length=26)
      'post_content' => string 'Lorem ipsum...' (length=14)

版本历史

1.2.0

  • 获取页面的摘要

1.1.0

  • 添加了通过Packagist发布的管道

1.0.0

  • 第一个版本