Filter posts by multiple tags from url

Hello,
I have a blog with posts that have several different tags.
I want to display posts for specific tags , but i want it to be determined from the url.
i.e mysite.com/tag/tag1,tag2,tag3

is there a way to achieve this? the only thing i managed to do is hard code the tags in filter in tag.hbs , but again i want it to be “dynamic” from the url.

Thanks in advance.

Hey @Idan_Levin, can I ask what you’re wanting to achieve? :slight_smile:

Hi @DavidDarnes , sorry for the late reply.
I want to “market” the blog in a bunch of different ways.
For example let’s say one distribution will target sports and lifestyle , other distribution will be books and science and so on.
I want to use the same site address and just filter out the relevant tags for each distribution.

I see, thanks for the explanation. In that case I’d urge you to create those routes on an as-needed basis. If you’re trying to focus on a certain demographic and trying to bring an audience in I’d advise creating custom routes for that demographic :slight_smile:. Take a look at custom routes and collection in our docs, this would be the best method to create your URLs to market:

https://ghost.org/tutorials/creating-content-collections/

@DavidDarnes , Thanks.
I will try this approach.

1 Like