Technical Questions - Dynamic Filtering, Show Latest Posts for each Tag, & Fixed Tags in Post Editor

Hi all, I have three technical questions I need help with:

1. Dynamic Filtering
Is it possible to filter posts for a particular author without reloading the page? For example, I have a dropdown menu in the author page with all the tags to its posts. If I select the tag ‘nature’ from the dropdown I want to see only the posts with the tag ‘nature’. How can I do this?

I tried doing some JavaScript but I do not know how to pass values to a handlebar (e.g. update {{get posts filter=‘text-to-filter’}} via JS). Any ideas?

2. Show Latests Posts for Each Tag
Is it possible to show the 3 latests posts for each tag? For example, I have a lists of travel blogs with the primary tag as the continent. For each continent I want to show the 3 latests posts without having to filter each get helper 7 times (e.g. {{get posts filter=‘continent1’}}…). Any ideas?

3. Fixed Tags in Post Editor
Instead of having the options to insert any tag in the post editor ‘Tags’ setting, can I select the tags I use from a dropdown? Do I need to do anything to the package.json? How can I edit this part?

Thanks a lot in advance!

Hey @Jesus_Esquivel_Roman,

  1. The simplest way I’m thinking is rendering all posts of the author, and using JavaScript to show/hide posts depending on the selected tag. post_class helper outputs the tag of the post which could be handy in this situation. e.g. You could write some script to show the posts with the class tag-nature when “nature” is selected in the dropdown.

If you want to make it truly dynamic by loading the posts on demand, you might want to look at Content API. It supports filtering, so you can filter the posts based on the selected option.

  1. This sounds like pretty similar to what we did on the homepage of Ease theme. If that’s correct, you can find the source code here.

  2. Not sure if I fully understand the question. Would you elaborate on this bit more?

Thank you for replying! Very useful information, I will check it out and try it later.

Number 3 refers to the post editor in the Ghost Admin interface. In the post settings of the post editor, I can add any tags I want. Instead of doing this, is it possible to have a dropdown menu with fixed options?

For example, countries may be written differently in different languages or by different users (e.g. UK, United Kingdom, etc.). I would like to prevent this from happening by adding a dropdown menu with fixed options so other authors only have those options to choose from, instead of being able to add new ones in the editor settings.


The “Tags” field is actually a dropdown. It displays the available tags, plus it gives an option to create a new one.

If you’re worried about your staff users creating wrong tags, you can give them “Contributor” role which isn’t able to add/edit tags. You can learn more about the staff user capabilities here. Managing your team in Ghost: User roles and permissions - FAQ

1 Like

Oh I see I need to play more with the roles. I tried your other suggestions and they all work! Thank you so much for you help :blush:

1 Like