howdy folks,
quick question regarding accessing site.whatever
for posts that can be switched back & forth. so pretty much a previous & next button.
I have something working pretty damn well & uses the same type of layout I have made, but I use collections. so have a collection for games, sound etc. & like the way I can switch between these projects for the genre its in.
but with this reconstruction of the layout im using I cant use the site.whatever
option anymore, only if I set the site.whatever
to soemthing such as site.game
I can use, but since the layouts used for sound, design etc, I am unable to use it for those
this is the current for loop I am using at the bottom of my layout. im happy with the layout because it can be used for everything. but just wondering if I can affect the site.whatever
for each page with something like page directory: game
{% assign sorted = site.whatever | sort:'order' %}
{% for post in sorted %}
{% if post.url == page.url %}
{% assign post_index0 = forloop.index0 %}
{% assign post_index1 = forloop.index %}
{% endif %}
{% endfor %}
{% for post in sorted %}
{% if post_index0 == forloop.index %}
{% assign next_post = post %}
{% endif %}
{% if post_index1 == forloop.index0 %}
{% assign prev_post = post %}
{% endif %}
{% endfor %}
can I affect the site.whatever
to something like site.{{ page.directory }}
, so I can choose how it cycl/es thru tho posts so I can use next/previous for the collections
thanks. I hope this made sense