Webflow sync, pageviews & more.
NEW
Answers

How can I make the Google reviews on my Webflow store locations dynamic by using the CMS template and place IDs sourced from the CMS item? How can I retrieve the location ID from the store CMS field and insert it into the script? Additionally, why am I only able to display 5 reviews? Are there other parameters or settings affecting this number?

To make Google reviews on your Webflow store locations dynamic using the CMS template, you can follow these steps:

1. Retrieve the location ID from the store CMS field: Assuming you have a CMS collection named "Store Locations" with a field called "Location ID," you can simply insert this field in your CMS template wherever you want to display the Google reviews. For example, if the field is named "Location ID," you would use `{{storeLocations.locationID}}` to retrieve the location ID value.

2. Insert the location ID into the script: You'll need to modify the Google Maps Places API script to dynamically insert the location ID. Replace the static location ID in your existing script with the dynamic value from the CMS template. To do this, you can use Webflow's custom code feature. In the Head section of your project settings, add a script tag with the modified code that includes the dynamic location ID.

Now, let's address the limit of displaying only 5 reviews:

The limit of displaying only 5 reviews is a restriction set by the Google Maps Places API itself. By default, the API returns up to 5 reviews per place. Unfortunately, there are no parameters or settings within Webflow or the CMS template that directly affect this number.

However, you can consider using the "Place Details" API instead of the "Place Search" API to retrieve additional review data. The "Place Details" API allows you to fetch more detailed information about a specific place, including all available reviews. With this API, you can retrieve all the reviews associated with a specific location ID, and then use Webflow CMS and custom code to display the desired number of reviews on your website.

To implement this, modify your script to use the "Place Details" API instead, and make sure to include the necessary API key and location ID variables. Then, you can use JavaScript and Webflow's custom code section to parse the review data and display it on your site.

Remember to adhere to Google's terms of service and usage limits when using the Places API, and ensure that you have obtained and set up an API key correctly.

I hope this helps you make your Google reviews dynamic and overcome the limitation of displaying only 5 reviews on your Webflow store locations!

Rate this answer

Other Webflow Questions