# How to group posts dynamically

**URL:** <https://forum.ghost.org/t/how-to-group-posts-dynamically/13697>\
**Category:** Developer help\
**Created:** [April 20, 2020, 1:05pm UTC](https://forum.ghost.org/t/how-to-group-posts-dynamically/13697 "2020-04-20T13:05:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amedeo\_Lomonte](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/amedeo_lomonte/32/6129_2.png) [@Amedeo\_Lomonte](https://forum.ghost.org/u/Amedeo_Lomonte)\
**Post date:** [April 20, 2020, 1:05pm UTC](https://forum.ghost.org/t/how-to-group-posts-dynamically/13697/1 "2020-04-20T13:05:32Z")

</div>

Hi,  
I would like to create a travel blog, and I’d like to have the images of the continents on the home page, when you click on one of them a page will open containing only the states belonging to that continent, in turn when you click on a state you will see the cities connected to the state and last when click on a city I would like to see the articles / posts related to that city.  
I don’t know how to handle all these subdivisions (continen-\>states-\>city-\>articles/posts).

-In you opinion, which is the best way to obtain this result?

-Do I have to create a customized HBS file for each continent, state and city?  
I think it can be very expensive to do. I should really create many pages.

-Is there any way to create only one template for continent, state and city that fits the click request?  
I’m making several attempts, but I can’t pass parameters via the URL, so I think anything dynamic can be created.

Please, any advice is welcome.

Kind regards,  
Amedeo

---

<div class="post-metadata">

**Author:** ![DavidDarnes](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/daviddarnes/32/3533_2.png) [@DavidDarnes](https://forum.ghost.org/u/DavidDarnes)\
**Post date:** [April 20, 2020, 1:36pm UTC](https://forum.ghost.org/t/how-to-group-posts-dynamically/13697/2 "2020-04-20T13:36:53Z")

</div>

Hey @Amedeo_Lomonte,

I think you might benefit from checking out our theme docs where we’ve provided detailed information how how template work in Ghost and how you can create custom templates for specific routes or pages:

> **[Ghost Handlebars Theme Structure - Developer Documentation](https://ghost.org/docs/themes/structure/)**
>
> Discover the building blocks of a Handlebars theme in Ghost and start building a custom publication of your own! 👻

---

<div class="post-metadata">

**Author:** ![Amedeo\_Lomonte](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/amedeo_lomonte/32/6129_2.png) [@Amedeo\_Lomonte](https://forum.ghost.org/u/Amedeo_Lomonte)\
**Post date:** [April 20, 2020, 2:40pm UTC](https://forum.ghost.org/t/how-to-group-posts-dynamically/13697/3 "2020-04-20T14:40:35Z")

</div>

Hi David,  
I already read your documentation, I just want someone to tell me what would be the most optimized method for what I want to do.

Please, can you answer my question?

---

<div class="post-metadata">

**Author:** ![DavidDarnes](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/daviddarnes/32/3533_2.png) [@DavidDarnes](https://forum.ghost.org/u/DavidDarnes)\
**Post date:** [April 20, 2020, 3:59pm UTC](https://forum.ghost.org/t/how-to-group-posts-dynamically/13697/4 "2020-04-20T15:59:07Z")

</div>

Your grouping convention is somewhat complex, I’m wondering if it needs to be for the task at hand. Also you’re using continents and states to group locations, but not countries? This will be an issue as not all continents / countries are using states to divide areas.

Maybe you should check out tags and primary tags, this might be a good starting point for structuring your content into groups:

> **[Organising Content in Ghost - FAQ](https://ghost.org/help/organising-content/#private-tags)**
>
> Ghost has a flexible organisational taxonomy called tags, which can be assigned from post settings menu within the Ghost editor.

---

<div class="post-metadata">

**Author:** ![Amedeo\_Lomonte](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/amedeo_lomonte/32/6129_2.png) [@Amedeo\_Lomonte](https://forum.ghost.org/u/Amedeo_Lomonte)\
**Post date:** [May 1, 2020, 2:32pm UTC](https://forum.ghost.org/t/how-to-group-posts-dynamically/13697/5 "2020-05-01T14:32:24Z")

</div>

Thank you.
