Trying to Add Ryviu Reviews to Featured Products and Collection Pages (Mobilia) Theme

Highlighted
New Member
1 0 0

I've added the below code to the product-thumbnail.liquid per the instruction of Ryviu. https://docs.ryviu.com/en/articles/3008706-how-to-show-star-rating-on-your-shopify-collection-page

<!-- RYVIU APP :: COLLECTION-WIDGET-TOTAL -->	
<div class="ryviu-collection">
<ryviu-widget-total collection=1
     reviews_data="{{product.metafields.ryviu.product_reviews_info  | escape  }}"
     product_id="{{product.id}}" handle="{{product.handle}}">
</ryviu-widget-total>
</div>  
<!-- RYVIU APP

 

However the code looks different for my theme than what they use for an example.

 

{% assign collection_group_mobile = linklist.handle %}

<div class="featured_collections">
{% for link in linklist.links %}

{% comment %}
This section supports linking to collections, products, pages, and blogs. It will use the first image found in the page content or blog article.
{% endcomment %}

{% assign link_item = link.object %}
{% assign link_image = '' %}
{% capture link_title %}{{ link.title | escape }}{% endcapture %}

{% if link.type == 'collection_link' %}
{% if link_item.image %}
{% assign link_image = link_item.image.src | collection_img_url: '900x', scale: 2 %}
{% else %}
{% assign link_image = link_item.products.first.featured_image | product_img_url: '900x', scale: 2 %}
{% endif %}
{% elsif link.type == 'product_link' %}
{% assign link_image = link_item.featured_image | product_img_url: '900x', scale: 2 %}
{% elsif link.type == 'page_link' %}
{% if link_item.content contains "<img" %}
{% assign src=link_item.content | split: 'src="' %}
{% assign src=src[1] | split: '"' | first %}
{% if src %}
{% assign link_image = src %}
{% endif %}
{% endif %}
{% elsif link.type == 'blog_link' %}
{% if link_item.articles.first.image %}
{% assign link_image = link_item.articles.first.image | img_url: '900x', scale: 2 %}
{% elsif link_item.articles.first.content contains "<img" %}
{% assign src=link_item.articles.first.content | split: 'src="' %}
{% assign src=src[1] | split: '"' | first %}
{% if src %}
{% assign link_image = src %}
{% endif %}
{% endif %}
{% endif %}

{% if sidebar %}
<div class="{% if collections_per_row == "2" %}six columns {% cycle 'alpha', 'omega' %}{% elsif collections_per_row == "3" %}four columns {% cycle 'alpha', '', 'omega' %}{% else %}three columns {% cycle 'alpha', '', '', 'omega' %}{% endif %} {% cycle collection_group_mobile: 'even', 'odd' %} thumbnail">
{% else %}
<div class="{% if collections_per_row == "2" %}eight columns {% cycle 'alpha', 'omega' %}{% elsif collections_per_row == "3" %}one-third column {% cycle 'alpha', '', 'omega' %}{% else %}four columns {% cycle 'alpha', '', '', 'omega' %}{% endif %} {% cycle collection_group_mobile: 'even', 'odd' %} thumbnail">
{% endif %}
<a href="{{ link.url }}" title="{{ link_title }}">
{% if link_image != '' %}
<img src="{{ link_image }}" alt="{{ link_title }}" />
{% endif %}

<div class="info">
<span class="title">{{ link_title }}</span>
</div>
</a>
</div>

{% if collections_per_row == "2" %}
{% cycle '', '<br class="clear product_clear" />' %}
{% elsif collections_per_row == "3" %}
{% cycle '', '', '<br class="clear product_clear" />' %}
{% elsif collections_per_row == "4" %}
{% cycle '', '', '', '<br class="clear product_clear" />' %}
{% endif %}
{% endfor %}
<div class="clear"></div>

I added the code to where I thought it would work for my theme. It didn't work and now the titles for the products on the collections pages are all messed up. I would like to first now how to fix the titles and then figure out how to add the reviews widget.

Here is a link to what my site currently looks like. Any help would be greatly appreciated.

https://borderlandrustichardware.com

0 Likes