upassist/neos-googlereviews
Composer 安装命令:
composer require upassist/neos-googlereviews
包简介
Google Reviews integration for Neos CMS — fetch and display Google Place reviews with caching
README 文档
README
Fetch and display Google Place reviews in Neos CMS. Provides a content element, Eel helper, CLI commands, and automatic caching.
Supports both the legacy Google Maps API and the new Google Places API (v1).
Requirements
- Neos CMS 7.3+ / 8.x
- PHP 8.1+
- A Google Cloud API key with the Places API enabled
Installation
composer require upassist/neos-googlereviews
Configuration
Add your API key and default Place ID in Settings.yaml:
UpAssist: Neos: GoogleReviews: apiKey: 'YOUR_GOOGLE_API_KEY' defaultPlaceId: 'ChIJ...'
All options
| Setting | Type | Default | Description |
|---|---|---|---|
apiVersion |
string | 'legacy' |
'legacy' for Maps API, 'new' for Places API v1 |
apiKey |
string | '' |
Google Cloud API key (required) |
defaultPlaceId |
string | '' |
Fallback Place ID when not set on the document |
cacheLifetime |
integer | 86400 |
Cache TTL in seconds (24 hours) |
maxReviews |
integer | 5 |
Maximum number of reviews to fetch (Google API limit is 5) |
language |
string | 'nl' |
Language code for API responses |
Usage
Content element
Insert the Google Reviews content element in the Neos backend. It displays a rating summary and individual review cards in a responsive grid.
The element reads the Place ID from the nearest document node (via the GooglePlaceId mixin) or falls back to defaultPlaceId from settings.
Editor options in the inspector:
- Show author photo - Display reviewer avatars
- Max displayed reviews - Slider from 1 to 5
- Show link to all reviews - Link to Google reviews page
Document mixin
Add the mixin to any document NodeType to enable per-page Place ID configuration:
'Your.Package:Document.Page': superTypes: 'UpAssist.Neos.GoogleReviews:Mixin.GooglePlaceId': true
This adds a "Google Reviews" tab in the inspector where editors can set the Place ID.
Eel helper
Use the GoogleReviews helper directly in Fusion:
# Get all data (rating, totalReviews, reviews array)
data = ${GoogleReviews.getData(placeId)}
# Individual accessors
reviews = ${GoogleReviews.getReviews(placeId)}
rating = ${GoogleReviews.getRating(placeId)}
totalReviews = ${GoogleReviews.getTotalReviews(placeId)}
The placeId argument is optional; it falls back to defaultPlaceId from settings.
CLI commands
Find a Place ID:
./flow googlereviews:findplaceid "Your Business Name City"
Fetch and cache reviews:
./flow googlereviews:fetch [placeId]
Clear the cache:
./flow googlereviews:clearcache [placeId]
Styling
The package ships minimal structural CSS. Override styles in your site package for branding. All classes use the BEM convention with the google-reviews block:
.google-reviews
.google-reviews__summary
.google-reviews__grid
.google-reviews__card
.google-reviews__stars
.google-reviews__star--filled
.google-reviews__footer
.google-reviews__cta
The grid uses a --reviews-count CSS custom property and collapses to a single column below 768px.
Caching
Reviews are cached using Flow's file-based cache backend. On API errors, stale cached data is served as a fallback. Use the clearcache CLI command or wait for the TTL to expire.
API versions
| Version | Endpoint | Auth method | Notes |
|---|---|---|---|
legacy |
maps.googleapis.com |
Query string | Widely available, enable "Places API" |
new |
places.googleapis.com/v1 |
X-Goog-Api-Key header |
Requires "Places API (New)" enablement |
Translations
Includes English and Dutch translations out of the box. Add your own XLIFF files in the standard Neos translation path.
License
MIT
upassist/neos-googlereviews 适用场景与选型建议
upassist/neos-googlereviews 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 upassist/neos-googlereviews 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 upassist/neos-googlereviews 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-31