The pattern suggester is a free widget for LYS websites to help inspire your customers. When placed on your store’s website, the widget uses the page’s title to identify the yarn being sold. It then searches the Ravelry pattern database for patterns made for that yarn that are either free or available to purchase online. It presents a randomly selected popular pattern to display, with the name, the designer, a picture, and a link to the Ravelry pattern page.
Try it out for yourself! Enter a website URL or the name and brand of a yarn to test the widget.
Widget Options
Select some options to personalize the widget, to make sure it fits with the style of your website. Then copy the code below and paste it in your website code.
The widget will be invisible unless there is a yarn and matching pattern found for the title of the site. When visible, it will appear wherever you place the code.
<div class="pattern-widget" ></div> <script src="https://patterns.code402.com/widget/widget.js" async></script>
{%- if product.type == "yarn" -%} <div class="pattern-widget" ></div> <script src="https://patterns.code402.com/widget/widget.js" async></script> {%- endif -%}
To add the widget to the description of your Shopify Products, nagivate to the Product Template, typically found in the Sections folder of your Theme code. Paste the code below the product.description line. You can change the product.type here based on the types you have given your products, or remove the if and endif lines to apply the widget to every product in your shop.
If you are having any problems putting the widget on your site, or to alert us of an error in our suggested yarns or patterns, please contact us at jennifer@code402.com.