How to use the Liquid Block in "Featured collection - blocks" Section to Add Custom Review Apps
When customizing your Featured Collection - Blocks section in Design Packs, you may want to integrate third-party review apps or custom code that requires product-specific information. The Liquid block provides a powerful way to accomplish this. Let's explore how to use it effectively.
Understanding the Liquid Block in Featured Collection - Blocks
The Liquid block allows you to insert custom HTML, JavaScript, and Liquid code into your product cards. One of its most powerful features is the ability to access product data through special placeholders.
Available Product Placeholders
The Featured Collection - Blocks section's Liquid block supports several product-specific placeholders:
[[ product.id ]] - The product's unique identifier
[[ product.handle ]] - The product's handle/URL slug
[[ product.url ]] - The full product URL
[[ product.description ]] - The product description
[[ product.metafields.reviews.rating_count ]] - Review count metafield
[[ product.metafields.reviews.rating.value ]] - Review rating metafield
Adding Review Apps
Example 1: JudgeMe Reviews
Here's how to add JudgeMe review stars to your product cards:
In your Featured Collection - Blocks section, add a new block
Select "Liquid/HTML" as the block type
Insert this code:
Example 2: Loox Reviews
To add Loox review stars:
Best Practices for Featured Collection - Blocks
Block Ordering: Place review blocks after the product title but before the price for optimal visual hierarchy
Mobile Optimization: Test how your review displays look on mobile devices, as the Featured Collection - Blocks section can display differently on smaller screens
Performance: Consider using the section's built-in lazy loading for optimal performance
Styling: Use the section's custom CSS settings to style your review elements consistently with your theme
Troubleshooting Common Issues
If your implementation isn't working:
Verify that the app is properly installed on your store
Check that you're using the correct placeholder syntax ([[ ]] not {{ }})
Ensure any required metafields are properly set up
Verify the block order in your section settings
Advanced Usage
You can combine multiple placeholders and add conditional logic to create more sophisticated displays:
Styling Tips
The Featured Collection - Blocks section provides two Custom CSS fields under the "Advanced" settings:
CSS: Applied across all screen sizes
Mobile CSS: Applied only on screens smaller than 480px
Adding Custom CSS
Navigate to your section settings
Scroll down to "Advanced"
Find the "CSS" field
Add your styles using this format:
Mobile-Specific Styling
To add styles that only apply to mobile devices:
Find the "Mobile CSS" field under "Advanced"
Add your mobile-specific styles:
Important Notes:
Each CSS declaration must end with a semicolon (;)
The Mobile CSS will override the main CSS for screens smaller than 480px
Keep your selectors simple to ensure they work properly
Test your styles across different screen sizes to ensure proper display
By utilizing both CSS fields, you can create responsive, well-styled review displays that look great on all devices.
Last updated