I have a scenario I am trying to solve with templates and routes but I am missing basic understanding and I can’t understand the documentation at Ghost Themes - Dynamic URLs & Routing
I have created a custom page (template) called news. This page will show a static introduction and then 2 links, Media and Meetings.
I then want to template page to show all posts that have the tag news as default and then filter posts on the tags news and media or news and meetings if they click on the buttons.
My approach has been to create these routes:
/news/:
permalink: /news/
template: news
/news/media/:
permalink: /news/media/
template: news
/news/meetings/:
permalink: /news/meetings/
template: news
news.hbs looks something like this:
<some html>
<a href="/news/">Show all</a>
<a href="/news/media/">Media</a>
<a href="/news/meetings/">Meetings</a>
{{#get "posts" limit="all" filter="a variable"}}
<div class="gh-topic gh-topic-grid">
<div class="gh-topic-content">
{{#foreach posts}}
{{> "loop-grid"}}
{{/foreach}}
</div>
</div>
{{/get}}
I now want to pass the filter into “a variable” from the routes so they get the values
tags:news or tags:news+tags:media or tags:new+tags:meetings
Is this possible and how can I do this?
Thank you