Coder Social home page Coder Social logo

shopify-tag-cloud's Introduction

Shopify-Tag-Cloud

Creates a tag cloud for Shopify blogs.

Works by counting up the tags and turning the count output into a numerical operator. CSS rules determine that tags with larger counts get larger font sizes.

Instructions

  1. Place tag-cloud.liquid snippet where you want your cloud to appear in blog.liquid, OUTSIDE of pagination rules.
  2. Replace BLOG-HANDLE with your blog's handle in Line 2, eg: {% for tag in blogs['my-blog'].all_tags %}
  3. Add tag-cloud.scss to your stylsheet.

Limitations

Shopify only pulls meta data (eg tags) for the first 50 blog posts in any loop (see https://ecommerce.shopify.com/c/ecommerce-design/t/blog-tag-count-is-wrong-134716), so your tag cloud tag count will never reflect your full blog if you have more than 50 posts. For this reason, I did not include the actual count next to the tag handles. If you have fewer than 50 blog posts at any given time, you can add ({{ count }}) next to {{ tag }} in line 15 to display the count [eg: Home (12) Garden (10)]. I also suggest adding {{ count }} while implementing this to test it.

shopify-tag-cloud's People

Contributors

namurray avatar

Stargazers

Timothy Solomon avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.