Reputation: 385
Sorry for my weak technical language. I am playing with the Shopify and get stuck on an issue.
So, the issue is, I have some blog entries, say testimonials. I am trying to display these testimonials on every page.
this is my sample blog entries
this is a page which will use the blog entries
{% for article in blog.articles %}
<ul class="news">
<li><span class="testimonial">"{{ article.content }}"</span>
<p class="author">{{ article.title }}</p>
</li>
</ul>
{% endfor %}
I figure it out I cant access the blog on my page... when I try this code on the page to access the blog entries.. it did not work. but it is working if I use it on 'blog.xyz'
so my problem is, how can I read the blog entries on any page. I am thank full to all the developers...
Upvotes: 0
Views: 99
Reputation: 294
To access the testimonials in your custom page use this snippet (in the above example this should be placed in "page.rug-cleaning.liquid"):
{% for article in blogs.testimonials.articles %}
<ul class="news">
<li><span class="testimonial">"{{ article.content }}"</span>
<p class="author">{{ article.title }}</p>
</li>
</ul>
{% endfor %}
Upvotes: 1