iliain / silverstripe-google-config
为Silverstripe提供Google功能的管理面板
1.0.0
2023-07-26 04:20 UTC
Requires
- php: ^7 || ^8
- silverstripe/framework: ^4 || ^5
- unclecheese/display-logic: ^2 || ^3
README
提供一个独立于设置面板的行政界面,允许用户管理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中设置地点,以下是一个示例评论数据
选择地点后,您可以使用$ReviewBadge
和$ReviewsList
分别在前端模板中渲染徽章和评论列表。
待办事项
- 添加更多API
- 更新CSS以便在前端正确渲染(如小工具)