Blog sorting/reordering

Lemonade_NY
Shopify Expert
4 0 0

I am wondering if there is anyway to sort or reorder blog posts once they have been published.  Anything out there?  Plugin?  Code?  

Adam
0 Likes
tetchi
Shopify Staff (Retired)
Shopify Staff (Retired)
489 0 43

Hey Lemonade,

Unfortunately the only way to order the blog posts is alphabetically, either from oldest to newest or from newest to oldest. You can set it so that they are ordered chronologically by their 'published_at' date, which is explained here: http://wiki.shopify.com/Article#article.published_at

www.tetchi.ca | www.twitter.com/t3tchi
0 Likes
steven
Shopify Partner
49 0 1

how exactly do you sort by the 3 options?

"alphabetically, either from oldest to newest or from newest to oldest."

I can't see an option in the blog admin...

0 Likes
Jamie
Shopify Staff (Retired)
Shopify Staff (Retired)
5717 0 152

The only way I know that you can sort natively is either in time forward or in time backwards. Backwards by using the reversed filter:

See reversing the loop:

https://github.com/Shopify/liquid/wiki/Liquid-for-Designers

You can try hacking it in jQuery but I wouldn't advise on more than a list of articles: http://ecommerce.shopify.com/c/ecommerce-design/t/sort-a-blog-alphabetically-i-was-so-close-46449

http://shopifyplus.com ::: http://twitter.com/bacchus
0 Likes
John_Paul_Hayes
Shopify Partner
19 0 3

You could sort them by article.id

{% assign article_list = blog.blog_name.articles | sort: "id" %}

{% for single_article in article_list %}

   {{article.title}}

{% endfor %}

 

-- Kind regards, JP
Schui_Baumann1
Tourist
7 0 4

Hey, I'm also trying to sort blog posts alphabetically. this works for me in blog.athletes.liquid. BUT the problem is, that this code won't work with tags anymore. /blog/athletes/tagged/xyz

<div id="page" class="desktop-12 tablet-6 mobile-3">
  <h1 class="page-title">{% if current_tags %}{{ blog.title | link_to: blog.url }} &raquo; {{ current_tags.first }}{% else %}{{ blog.title }}{% endif %}</h1>
  {% paginate blog.articles by 200 %}
    <div class="desktop-12 tablet-6 mobile-3">
    <div id="article-loop">
{% assign articles = blogs.athletes.articles | sort: 'title' %}
{% for article in articles %}
	 {% include 'athlete-loop' %}
{% endfor %}
    </div>
  </div>
   {% endpaginate %}
</div>

This code works with different tags, but it doesn't sort it alphatebitaly:

<div id="page" class="desktop-12 tablet-6 mobile-3">
  <h1 class="page-title">{% if current_tags %}{{ blog.title | link_to: blog.url }} &raquo; {{ current_tags.first }}{% else %}{{ blog.title }}{% endif %}</h1>
  {% paginate blog.articles by 200 %}
    <div class="desktop-12 tablet-6 mobile-3">
    <div id="article-loop">
      {% for article in blog.articles  %}   
      {% include 'athlete-loop' %}
      {% endfor %} 
    </div>
  </div>
   {% endpaginate %}
</div>

Any idea, how i could get it sorted alphabetically but also still work with tags?

0 Likes
JoePichardo
New Member
9 0 0

Hey Lemonade_NY, I've actually made an app to drag and drop blogs into the positions you would like. Here's the link to the Shopify App: Article Organizer Pro

0 Likes