Multiple sorting using drop down menu / option / modal etc

Hello everyone, pretty new here. Wanted to ask how to implement a sorting component like the one this forum uses in ghost cms. Is something like this possible inside the cms?

I know there have been similar posts before…The specific question is how can one do a multi option sorting. Like for instance - this forum can sort in categories drop down and another tag like in progress / shipped / rejected etc… I have successfully integrated a drop down to sort by one function, but not several at the same time.

image

my thoughts on the forum is that the categories have one tag. When selecting ideas, the second drop down already narrows down the other tags that are listed with the tag ‘categories’ - and then it sorts based on those fetch conditions. I am just not sure how to make the syntax work to prepopulate the second drop down to sort tags based on the condition of the first drop down menu and then fetch both should both tags be present in the post condition.

By the way. Thank you for Ghost!!!

In the meantime, i will keep tinkering. Thank you for any help in advance!!!

here is another integration of what I am talking about. This is the ghost themes page.

Here is a code snippet to listing tags in only 1 drop down.

<label for="select-tags">Tags:</label>
<select name="tags" id="select-tags" onchange="window.location.href = event.target.value">
  <option value="/" {{^is "tag"}}selected{{/is}}>{{t "Show all"}}</option>
  {{#if tag}}
    <option value="/tag/{{tag.slug}}" selected>{{tag.name}}</option>
  {{/if}}
  {{#get "tags" include="count.posts" order="count.posts desc" limit="20"}}
    {{#foreach tags}}
      <option value="/tag/{{slug}}">{{name}}</option>
    {{/foreach}}
  {{/get}}
</select>

The forum doesn’t run on Ghost. That’s Discourse. :slight_smile:

The themes page looks like it could be Ghost. A quick look at the source code says that the page is loading all the themes (I suspect each one is a “post”, if it’s running on Ghost), and then some javascript changes the visibility of the themes based on the classes assigned to each one. You could absolutely build this into a Ghost theme.

Thank you @Cathy_Sarisky

ha, the forum had me fooled :). Although, i would think the themes page could be ghost, no?

The way I understand it, I am trying to populate a number of tags in a < select> function

in the code snippet above it populates all tags in ghost, and then for each value it sends it to the taxonomy of tag/{{slug}}

My question is

  1. Can i limit the search in the < select> function to a collection i.e.

< select name=“tags” id=“select-tags” onchange=“location = this.value;”>

  <option value="/" {{^is "tag" **in collection1** }}selected{{/is}}>{{t "Filter by Topic"}}</option>
  {{#if tag}}
  1. ‘’’ < select name=“tags” id=“select-subtags” onchange=“location = this.value;”> {{t "Filter by subTopic"}} {{#if tag}} {{tag.name}} {{/if}}

{{#get “tags” in include=“count.posts” filter"slug: [ collection 1, and all others ] }}
{{#foreach tags}}
{{name}}
{{/foreach}}
{{/get}} ‘’’

here is the example i am referring to (the select function below the slider). Although, in this case everything is hardcoded into yaml the function only links to the collection

https://www.autographarch.com/projects

Certainly could be. Not sure if it is or not. :slight_smile:

Your post got a bit mangled - if you’re pasting in code, use ``` to surround it and stop the forum from trying to parse the HTML.

Thank you! That helped @Cathy_Sarisky . Now I will know to use markdown.

  1. can i limit the search in the <select> function to a particular collection ?
< select name=“tags” id=“select-tags” onchange=“location = this.value;”>
  <option value="/" {{^is "tag" **in collection1** }}selected{{/is}}>{{t "Filter by Topic"}}</option>
  {{#if tag}}
  1. Can i list all tags that are also grouped with other tags in the 1st <select> function… i.e. :
<select name=“tags” id=“select-subtags” onchange=“location = this.value;”> {{t "Filter by subTopic"}} {{#if tag}} {{tag.name}} {{/if}}

{{#get “tags” in include=“count.posts” filter"slug: [ **collection 1, and all others** ] }}
{{#foreach tags}}
{{name}}
{{/foreach}}
{{/get}}