planetadeleste/wn-locationtowns-plugin

为 Winter.Location 插件管理的州添加城镇。

2.0.2 2021-04-28 08:37 UTC

This package is auto-updated.

Last update: 2024-09-28 16:46:42 UTC


README

此插件是 VojtaSvoboda.LocationTown 的分支,迁移到 WinterCMS

为 Winter.Location 插件管理的州添加城镇。包括

  • 带有分页的州城镇组件
  • 城镇详情组件
  • Winter.Sitemap 的钩子
  • 扩展 Winter State 模型

必需插件:Winter.Location。

已测试最新稳定版 WinterCMS 1.1.3。

渲染城镇详情

此组件渲染城镇详情。只需创建一个带有 slug /town-detail/:slug? 的城镇详情页面,并插入城镇组件

Town component

要覆盖城镇详情模板,只需创建一个部分文件 /town/default.htm 作为 /plugins/planetadeleste/components/town/default.htm 的副本,并自行修改。

渲染城镇列表

创建一个带有 slug /towns/:page? 的城镇页面,其中页面表示分页。插入城镇组件。设置州过滤器和选择页以显示上面创建的城镇详情

Towns component

要覆盖城镇列表模板,只需创建一个部分文件 /towns/default.htm 作为 /plugins/planetadeleste/components/towns/default.htm 的副本,并自行修改。

将城镇添加到站点地图

只需安装 Winter.Sitemap 插件,并将一个城镇或所有城镇插入到站点地图中

Towns in sitemap

服务

插件提供的可用服务列表

locationtowns 服务

$towns = App::make('locationstown');
$town = $towns->findOneBySlug('praha');
$allTowns = $towns->all();
$townsByState = $towns->where('state_id', 285)->get();

Winter State 扩展

$state = \Winter\Location\Models\State::find('285');
$towns = $state->towns;

TODO

  • !!修复在 Town:114 和 Town:129 中的固定 URL 路径(应在组件中设置路径)
  • !仅通过城镇组件中的活动州进行过滤
  • 直接从 Winter.Location.State 扩展以管理与此州相关的城镇
  • 在没有 Winter.Location 的情况下运行插件(仅城镇管理)
  • 在后台列表中添加“国家”选择框以过滤州
  • 无法执行 october:down
  • 添加导入和导出

请随意发送 pullrequest!

贡献

请向 master 分支发送拉取请求。

许可证

LocationTown 插件是开源软件,根据与 OctoberCMS 平台相同的 MIT 许可证 许可。