wirelab/locations-module

此包已被废弃且不再维护。未建议替代包。

PyroCMS 3 的位置模块。

安装: 61

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:streams-addon

1.5.4 2017-06-20 08:40 UTC

This package is not auto-updated.

Last update: 2021-02-16 06:57:27 UTC


README

⚠️ 此存储库已弃用 ⚠️

带动态字段的 PyroCMS 3 位置模块。

覆盖默认视图

首选/项目特定方式

  1. php artisan addon:publish locations
  2. 编辑 resources/<站点名称>/addons/wirelab/locations-module/views/location 中的 show 视图

在自定义主题中

在主题的服务提供者中添加以下内容

protected $overrides = [
    'wirelab.module.locations::locations/view' => 'your view path here',
];

向位置添加字段

  1. 在位置模块中转到 fields 并创建一个新的字段
  2. locations 部分点击 assignments 并分配字段

向页面添加位置

  1. 在页面模块中创建一个 多个 字段,将其分配给位置 > 位置
  2. 将字段分配给页面类型
  3. 在页面类型循环中,对 page.your_slug 调用 render(),或对 page.your_slug 调用 render() 以使其为您循环。示例
page.your_slug.render()
{% for location in page.your_slug %}
	location.render()
{% endfor %}

不调用 render 将返回位置的属性。

{% for location in page.your_slug %}
	{{ location.name }}
	{{ location.email }}
{% endfor %}