Hi , Sorry really struggling as I try and learn grav.
I have been looking at trying to use a way to get to loop through a child under a module to get post items, then use a simple scroller / slide idea to display the articles of news
I tried doing this with starting with a modular item called _features taken from the woo template.
The page layout from under admin
_testimonials
Where i have then created a sub dir called 01.blog then added the pages below it
so _testimonials
_modular_blog 01.blog
_modular_blog/item sub directory non prefixed
Is this the correct way or I dont need to use the 01.blog entry and just have the items listed as sub directories underneath
I have then looked at the code in blogs and item twig and seem to get really lost in it
because the testimonials (user/theme/woo/templates/modular/testimonals.twig.html)
could some one point us how to loop through the articles and get the heading title and the content as I just cant seem to return anything!
So please the best practises for accomplishing something like this would be appreciated
Thank you
_testimonials
modular/blog/01.blog
modular/blog/item
Since posting I found that it doesn't need to be in a sub-directory of 01.blog I can just leave the folders in the route of _testimonials
I have just included a image of the current layout of pages
but struggle to work out to loop through the directories and access the page content etc Grav
I kinda of understand that I need to get the items as collection of pages and then step through them outputting the fields of title and content in to a bullet list
but struggling how to do it and find anything to give me direction even after looking at the blog code of antimatter
{% block content %}
{% set collection = page.collection() %}
{{ content }}
<ul class="slides">
{% for post in collection %}
<li>
<blockquote>
<h4>{{ post.title }}</h4>
<p> {{ post.content }}</p>
</blockquote>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
<span><i class="quote-right fa fa-quote-right"></i></span>
</div>
{% endblock %}
css
This was using / devolped created with a the woo theme which has the font-awesome included so css used
#testimonials .quote-left {
left: 5%;
}
#testimonials .quote-left, #testimonials .quote-right {
position: absolute;
top: 50%;
color: #fff;
font-size: 40px;
margin-top: -25px;
}
.fa {
display: inline-block;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
file can be downloaded by https://1drv.ms/u/s!Asx43U2CMes5gXFvdaL0au9t4Lsg
this doesnt included the woo theme, so that will need to be downloaded first and this will just update the files to work