iliain/silverstripe-google-config

为Silverstripe提供Google功能的管理面板

安装: 7

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:silverstripe-vendormodule

1.0.0 2023-07-26 04:20 UTC

This package is auto-updated.

Last update: 2024-09-26 06:54:54 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

提供一个独立于设置面板的行政界面,允许用户管理GTM脚本、评论等。

安装(使用composer)

composer require iliain/silverstripe-google-config

配置

根据您使用的API,您可能需要包括密钥的环境变量,如下所示

GOOGLE_MAPS_API_KEY="xxxxxxxxxxxxxxxxxxxxx"

目前该模块使用以下API

  • Google Places

使用方法

您可以通过$GoogleConfig在前端调用Google设置中的数据,如下所示

{$GoogleConfig.HeadScripts.RAW}

<% with $GoogleConfig %>
    <% if $Places %>
        <% loop $Places %>
            ...
        <% end_loop>
    <% end_if %>
<% end_with %>

地点

在CMS中设置地点,以下是一个示例评论数据

Example of setting up a Place

选择地点后,您可以使用$ReviewBadge$ReviewsList分别在前端模板中渲染徽章和评论列表。

待办事项

  • 添加更多API
  • 更新CSS以便在前端正确渲染(如小工具)