@RyanF I know my syntax is incorrect where i try to access the query param. You mentioned article there is no any thing about query param. I want to know, how to access query param on handlebar ?
I don’t think the version of handlebars that Ghost uses can do that.
If you have a small number of ‘types’, you could set up a route (in routes.yaml) for each one, with the appropriate filter.
If you have a lot of types or need more complicated filtering, you could use javascript on the client side to retrieve the appropriate posts from the API and render them. (Themes with ‘load more’ buttons that append posts onto the bottom of the page are doing this, so that could be a good place to start.)
@RyanF, If we can’t access query param data in handlebar files as said by @Cathy_Sarisky, it is a silly and avoidable drawback of this CMS. I suggest you, implement this feature as a built-in helper.
You can make a case for the feature in the #ideas channel
What are you trying to accomplish, aside from using the query params? As Cathy mentioned, there are likely other methods in Ghost for accomplishing what you want, which can ultimately be preferable to a query param, even when it comes to SEO.
@RyanF i need to create a post portfolio page with a filter with pagination. Also i want share the link which is having the filter results. What are the options in ghost have to create a complex filter?
The way to organize and present content like this in Ghost is not by filtering via query params, but rather via something like Channels and custom routes.
(the below link jumps to the Channels section)
(Collections are another, different option, also found on the page linked above).
In example:
A Channel on a route of /resources/ with some tags case-studies, other-tag-1, other-tag-2
Blockquote What if i need filter with multiple tags?
Example: I need to load all case-studies and datasheets.
If filtering the sub categories of resources for display purposes is a UX concern, there are a bunch of ways to approach that depending on how you need it to work. Dynamically with javascript being one, or perhaps nested route-dependent #has blocks in the template, or by a combination of collections and channels.