Jump to content

Universal Filter: sort tags by frequency / hide if no results / data-item-count

Recommended Posts

Site URL: https://www.davidzipper.com/articles

@michaeleparkour thanks for your awesome universal filter plugin. Need some help with advanced use.

I'm wondering if there's a way to show the number of items that each tag contains. See the example below - that's what I am hoping to achieve.

showItemsCount only shows the total number of items in the entire container.

Secondarily, I'd like to rank the tags in order by highest frequency to lowest. So: 

Safety (6)
Federal Policy (5)
Cars (3)
Climate (2)
Bikes (2)

...etc. 

Thanks for your help.  

835774507_ScreenShot2021-01-14at9_22_28AM.png.3fd7ef0c533327043dbf26d39d3885a4.png

Link to comment
  • Replies 5
  • Views 620
  • Created
  • Last Reply

Answering the first part of my own question - figured it out. It's: 

@michaeleparkour I still need help figuring out how to then rank the tags by optionsCounters; largest to smallest. Can you help? 

 

updateFilterOptions: {  showOptionsCounters: true,
                    optionsCounterWrap: '- ()',
                              nonExistOptions: {
                        hide: true,
                        disable: false, 
                        disableHard: false, 
                        moveBottom: true
                    },
                },
Link to comment
1 hour ago, jtreese01 said:

Answering the first part of my own question - figured it out. It's: 

@michaeleparkour I still need help figuring out how to then rank the tags by optionsCounters; largest to smallest. Can you help? 

 


updateFilterOptions: {  showOptionsCounters: true,
                    optionsCounterWrap: '- ()',
                              nonExistOptions: {
                        hide: true,
                        disable: false, 
                        disableHard: false, 
                        moveBottom: true
                    },
                },

No such function by default - but you have sort in dropdowns, it is asc  or desc by default  but you may write custom function and sort in the way you need there

Link to comment
  • 1 month later...

@MichaelMashai Hi Michael! We love the filter you created! I am wondering if there is a way to make the TAGS more sophisticated. 

See the screenshot attached.

For Example: Someone picks CATEGORY Strength and then picks the TAG (we changed the name to Filter) Kettlebell. But, if they then select the TAG Beginner they are seeing all videos tagged Kettlebell and Beginner. We would like it to narrow to just Beginner videos that include Kettlebell. The second tag of Beginner is adding more videos when we want it to subtract to just show Beginner Kettlebell videos.

Does that make sense?

 

 

Screen Shot 2021-02-19 at 11.51.42 AM.png

Link to comment
On 2/20/2021 at 2:54 AM, carollyne said:

@MichaelMashai Hi Michael! We love the filter you created! I am wondering if there is a way to make the TAGS more sophisticated. 

See the screenshot attached.

For Example: Someone picks CATEGORY Strength and then picks the TAG (we changed the name to Filter) Kettlebell. But, if they then select the TAG Beginner they are seeing all videos tagged Kettlebell and Beginner. We would like it to narrow to just Beginner videos that include Kettlebell. The second tag of Beginner is adding more videos when we want it to subtract to just show Beginner Kettlebell videos.

Does that make sense?

 

 

Screen Shot 2021-02-19 at 11.51.42 AM.png

You should contact via his site. He can provide faster answer

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.