About Stacks Guru

Stacks Guru is born from the need to search the vast number of videos out there on stacks built for Stacks Pro and the Stacks 5 plugin for Rapidweaver.

We have scraped over 500 videos to get the transcripts for each in order to make the spoken word searchable.

Please use this free tool to help you learn and discover the awesome power that Stacks and the stacks made for Stacks have to offer.

Stacks Guru

Video Reference

Leave a Tip!

Every little bit helps to keep this going. I'll be doing my very best to keep up with the likes of Joe when it comes all the videos he posts!

Feeds - Sorting and Filtering your Feeds thumbnail

Feeds - Sorting and Filtering your Feeds

This video reviews all the ways to filter and sort the data in your Feeds. For more info about Feeds, head over to https://www.weavers.space/stacks/feeds

Categories: Demo

Transcript

don't know
[Music]
so in this video I want to go over how
we can use the sort and filter features
inside of feeds now the this is the
feeds demo file I am using the total CMS
feed here
um that's just because I have some
decent data that I can filter out but it
doesn't really matter at all what your
feed is
um the sorting and filtering features
work on any sort of feeds databases RSS
CSS files CVS or CSV files the files
Pack videos I mean it doesn't matter you
can filter and sort on every feed
so let's dive in there are two different
kind of ways that we can sort and filter
and we're going to go over sorting first
but I do want to kind of go over the
nomenclature since they behave similarly
inside the main feedstack there is a
sort and filter function
however
um there may be the ability or time
where you want to do multiple filters or
multiple sorts
um so instead of adding multiple sort
and filter features here
um there is the ability to add a
pre-filter feed and pre-sort feed option
here so we can add pre-sort and
pre-filter now what's different with
these are I recommend that you add these
after all of your data feeds
okay because if you if you sort or
filter the data before your feed ever
gets added then nothing's gonna happen
Okay so you want to make sure that the
filters and the sorts happen after your
feed think of this as a logical
progression or importing our data we're
going to filter it and then we're going
to sort it okay you can have as many
filters and as many sorts as you want
now the if you also set the filter and
sorts inside of uh the main feedstack
they will happen after the pre-filters
okay so you don't have to have them here
um you can use just these if you like
um but for convenience if you only want
to do one sort or one filter it could be
useful to use them here okay the options
here and the options inside these Stacks
are identical so for the rest of this
demo I'm just going to show these child
Stacks just so it's kind of easier in
targeted example
um let's go over the sort
um so here we're going to provide by
default is no sort we want to sort so
essentially when you just do sort
um in most of these sort Fields you're
going to sort and you just provide the
actual field that you want to sort by
obviously if you Shuffle
um it's just going to shuffle the
records okay but all of these other ones
require that you actually Supply a field
name now how do you know that field name
um well hopefully if you're watching
this video you already know how to use
feeds and you can go ahead and say data
preview and if we preview in the browser
here
you'll see that we have all of the
fields that are listed that we can
actually filter by
Okay so
um in here I'm going to let's just sort
by title
I know this is a total CMS uh blog uh
feed so I'm going to go ahead and sort
by title
okay and here we go
um for some reason I have this odd one
that has numbers in it but after that
we'll notice that they are all sorted by
title
now we can also look at reverse sort so
we can reverse the sort and we preview
that we'll see that it then reverses the
sort
okay
now some other sort options here we have
natural sort and natural sort reverse
depending on what you want
um natural sort tends to do numbers
differently okay so if you if you're
ever sorted by a number you'll notice
that some com sometimes computers will
go one ten two three four you know so on
and so forth where natural sort will
actually then sort one two three four
five six seven eight nine ten eleven
twelve thirteen so natural start really
has to do with uh sorting better when
you have numbers involved if you know
you don't have numbers involved I do
recommend using sort because it's a
little less resource intensive not
anything noticeable but
um if you know you're not gonna have to
sort by natural number order
um definitely use sort versus natural
sort
okay now again if you wanted to sort by
title and then after you sort it by
title you wanted to sort by I don't know
the summary okay you can do that
so you can sort by title then sort by
summary and there we go
okay so it kind of gives us you know
multiple sort options here
so now let's dive into the filter
options and filter allows us to limit
the data essentially we're filtering out
data
so here I'm going to go ahead and now
there's two different types of filters
we can do a static filter
which says basically let's say I want to
show everything that has a tag of
Brazil's on there multiple times okay so
I'm going to go ahead and say I'm going
to do
um tags is Brazil
okay so
um it's static I only ever want to show
all blog posts that have a tag of Brazil
there we go
now if you notice in our rules we have a
lot of stuff so the default is equal to
so if a tag is equal to Brazil show it
but we can also do not equal to equal to
case insensitive not equal to case
insensitive starts with doesn't start
with so there's a lot of options here
contains doesn't contain if your
particular field is numbers do we do
less than or equal to
um if it's a Boolean field if it's true
or false is it empty is it not empty so
on and so forth there's also some date
logic in here if your field contains a
date so there's a lot of really powerful
logic in this to really give us a lot of
power okay so for example if I do
um starts with or actually let's do
contains okay contains Brazil
that's all that's still going to show us
both but watch if I do contains bra
okay it's still going to show these two
uh because both posts contain bra but if
I if I change this back to equal to so
tags equals to bra
it's going to show none because there
are no nothing that where the tag
exactly equals bra bra okay because it
was Brazil
so you can also do again starts with
ends with so on and so forth
so that's a static filter but what if we
wanted to dynamically filter our list
basically by like maybe passing some
functions to a URL
so we can go ahead and let's change this
to Dynamic URL filter
and what this does is we have the same
rules okay but now we only pass a URL
key so right now we're going to continue
to filter on the tags field
okay now let's preview
Now by default I haven't applied any
Dynamic filters to this so it's
displaying all blog posts
so let's go ahead and I'm going to go
ahead and add question mark tags
equal and let's do Brazil again
so there we go I've dynamically filtered
this by saying I want the tags to equal
Brazil so it's going to dynamically find
every post that the tag equals Brazil
again it still applies to this equal to
so for example and then if I change this
to go back to tags equals Google
there we go we show this particular one
that has Google as a tag now if I change
that to be something like g-o-g
it's going to return nothing because
there are no tags that have exactly that
but you can change that behavior if you
want right you can say contains
and if I preview this
let's just go back to this other one and
refresh that
there even though tags equals GOOG
because this contains that it will then
display the results so that's how we can
use Dynamic URL filters now
by default you can it will always ignore
a filter if it's not present
but
um if you uncheck this it's basically a
required option like you have to Define
that or else it's going to filter out
everything
so for example let's go ahead and turn
that checkbox off I'm going to refresh
and I don't have any filters to find
here so it's blank it's nothing right
because I'm not applying any filters
there are some use cases for that but I
think a majority of the time you're
going to want to make sure that that is
checked
and one other thing I should note is if
you wanted to support multiple filters
so if you wanted to do
um you know I want to filter by tag and
I'll potentially want to filter by
summary or something like that right
um You can go ahead and do that so let's
go ahead and do that now so let's say
and let's say summary contains and tag
is equal to
okay let's go ahead and preview that
so I'm going to do
um
we're going to do tags equals uh Brazil
again okay and let's say I want to make
sure my summary okay we're gonna do
um and summary equals
and we're going to do uh
uh uh plan right because it contains the
word plan in it for some reason this one
contains the word plan so there we go
and there we go so this is the only one
that can the summary contains the word
plan and we have a tag of Brazil right
so that's how we can kind of mix and
match filters again you don't require
them right so if I just did tags equals
Brazil I still get both so it's kind of
an optional thing
super powerful
um it's a it's a very powerful thing to
filter your data and really display now
if you don't obviously you don't want to
have users go ahead and you know typing
in the URLs so a really great way of
doing this is simply going and having
let's say a button okay or you know this
is the getting start the starter pack
button but we can go ahead and do a link
here so let's say I do
um
you know I can link to question mark
tags
um equals
um Brazil
okay and uh I can then uh change this
and say you know
uh Brazil posts
there we go um so if we preview this
I now have a button here that when I
click on it it filters by Brazil posts
so there's a lot of other ways you can
do this you can use like a foundation
six form with uses selects
um and so some more advanced options
um but you know this is a simple way of
just using a button
um and I think in in one of my feeds
videos I actually do um some select
boxes where I'm I'm actually you know
having a drop down menu to select buy
something and stuff like that
um I also did that on the made for
stacks.com website
um which actually uses feeds as well so
um check that out where I did an entire
tutorial on how I build uh that website
out so cool I hope you enjoy uh feeds
these are some great options for
pre-filtering and sorting super powerful
take care bye-bye
thank you
[Music]
Search the page
0