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

Feeds - Sorting and Filtering your Feeds thumbnail

Feeds - Sorting and Filtering your Feeds

04/13/2023
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

Transcript

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