e1commerce.com
Ask a question
  • New questions
  • With the answers
  • Unanswered
  1. Home
  2. How To Display Featured Posts From Multiple Blogs in Shopify?

879 votes
1 answers

How To Display Featured Posts From Multiple Blogs in Shopify?

Solution:

Have you tried the simplest of Liquid constructions like:

{% for blog in blogs %}
  <p>I am blog {{ blog.title }}</p>
{% endfor %}

Undefined asked
2022-12-3


604
votes

Answer

Solution:

Could you try this? Just add some more block schema

    
<div class = "blog-container">

    {% if section.settings.blog != blank %}
    {% for blog in section.settings.blog %}
     
     <p>{{blog.title}}</p>

    {% endfor %}

{% endif %}

{% if section.settings.blogone != blank %}
 {% for blog in section.settings.blogone %}
     
     <p>{{blog.title}}</p>

{% endfor %}

{% endif %}


{% if section.settings.blogtwo != blank %}
 {% for blog in section.settings.blogtwo %}
     
     <p>{{blog.title}}</p>

  {% endfor %}
{% endif % }
     </div> 

 {% schema %}
{
  "name": "Blog posts",
  "class": "index-section",
  "settings": [
    {
      "type": "text",
      "id": "title",
      "label": "Heading",
      "default": "Blog posts"
    },
    {
      "id": "blog",
      "type": "blog",
      "label": "Blog"
    },
 {
      "id": "blogtwo",
      "type": "blog",
      "label": "Blog Two"
    },
 {
      "id": "blogthree",
      "type": "blog",
      "label": "Blog Three"
    },
    {
      "type": "range",
      "id": "post_limit",
      "label": "Posts",
      "min": 3,
      "max": 12,
      "step": 3,
      "default": 3
    },
    {
      "type": "checkbox",
      "id": "blog_show_author",
      "label": "Show author",
      "default": false
    },
    {
      "type": "checkbox",
      "id": "blog_show_date",
      "label": "Show date",
      "default": true
    },
    {
      "type": "checkbox",
      "id": "show_view_all",
      "label": "Show 'View all' button",
      "default": false
    }
  ],
  "presets": [
    {
      "name": "Blog posts",
      "category": "Blog",
      "settings": {
        "blog": "News",
        "post_limit": 3
      }
    }
  ]
}
{% endschema %}




Undefined answered
2022-12-3
Link to answer


Source

Didn't find the answer?

Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Similar questions

Find the answer in similar questions on our website.

420 shopify - How to store value from loop in liquid to display it into the variable
73 How to enable / disable my app that is being managed from theme customization section shopify
296 How to bring HTML +JavaScript into TypeScript (Embed a Shopify Buy Button in a .tsx file)
885 javascript - Shopify - Facing issue when creating customer using shopify api
6 Showing shopify shipping rates based on weekday
427 How to create Shopify app that provides custom fields (inputs) on product detail pages?
396 python - Most efficient way to transform a JS React app/widget into a public shopify-app on the Shopify store
364 php - Shopify shows CSP error when I try to redirect my app within the iframe
194 Shopify Product Page How To Seperate Links From Metafields
540 Shopify liquid access to article object from handle

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.







Latest questions:

45 Triggering Zapier on new Shopify order containing a specific product

36 javascript - Swiper js - How can i change the background color of the selected slide

378 Shopify Webhooks not redirect into Laravel Route

497 How to enable / disable my app that is being managed from theme customization section shopify

913 Shopify List Blog Tags



© 2021

E-mail: infot@e1commerce.com