Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to show review stars within collection templates? #1

Open
atomgiant opened this issue Jun 30, 2021 · 4 comments
Open

How to show review stars within collection templates? #1

atomgiant opened this issue Jun 30, 2021 · 4 comments

Comments

@atomgiant
Copy link

I'd like to start a discussion about how to show the review stars for this sample app inside of a collection or search template.

For example, for each product in the collection, I'd like to see the average rating stars when viewing a collection or search template.

This use case doesn't seem to be directly supported with the new App Blocks unless I am mistaken. Do you have any tips you can share about how you might make this work?

Thanks,
Tom

@govindrai
Copy link

govindrai commented Nov 6, 2021

Wondering the same. Did you have any luck figuring this out @atomgiant?

@atomgiant
Copy link
Author

I don't believe OS2.0 supports this use case so there is no simple option that is OS2.0 native.

I decided to wait until after the holidays to decide which path to take to add app blocks to collection items.

I believe there are really only 2 options for this:

  • Manual snippet - use a standard snippet within the theme the "old-fashioned" way
  • App Embed block - use an App Embed block with JavaScript to insert the content dynamically. The content would need to be added to the page in a hidden way and then inserted for each product

The App Embed block would be a very brittle process and need to change for each theme. So based on this, I'm leaning towards just using the Manual snippet option for collection items, and App blocks for product pages.

IMO this is a glaring flaw with OS2.0 so I hope they'll add some form of support in the future.

@acoustic86
Copy link

@atomgiant It's been a few years and it still doesn't look like OS2.0 is supporing this usecase. Have you found a good solution?

@atomgiant
Copy link
Author

There are still no good options. If you want to use Liquid you have no choice but to modify the theme. I'm moving to web components and the Storefront API to load the data. There is the new theme blocks just announced that in theory allow nested blocks. However, I haven't looked to see if they intend to support collection grid item theme blocks. I've given up on Liquid being a viable choice for theme apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants