Ad
How Can I Read The Blog Entries On My Page In Shopify
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...
Ad
Answer
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 %}
Ad
source: stackoverflow.com
Related Questions
- → OctoberCMS - How to make collapsible list default to active only on non-mobile
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → when i send data with ajax(jquery) i don't find the values in controller without form in laravel 5.1
- → DropzoneJS & Laravel - Output form validation errors
- → Knockout JS - How to return empty strings for observable fields
- → How to replace *( in a string
- → Get the calling element with vue.js
- → Sent Variable to Controller via Ajax in Blade
- → AJAX folder path issue
- → Onclick with argument causes javascript syntax error
- → KNockout JS - Automatic reload of ajax call
Ad