Lesson info

The number field is a CMS field used in Collections, handy for displaying numeric values like statistics, prices, page counts, file sizes, and more.

Assets

Want to follow along with this lesson? Fortunately, we created a zip file which contains all the assets used in the project, and we've included that link 

right here
.

Transcript

The Number field is one of those magic fields that does way more than most people think. Yes, it's true: you can only put Numbers inside (integers, decimals...). But the magic isn't so much the field itself; it's how we can use these Numbers to accomplish a ton of work inside our projects.

What do we normally use Numbers for in a collection? Things like ratings, or rankings, or prices, or populations, quantities, season Numbers, episode Numbers, magic Numbers. We get the point.

Of course, we can bind any type of text inside a project to this field. But another really powerful way to use Numbers is in sorting.

If we've rated items on a scale from 1 to 5 and we want to show the highest-rated items first? We can sort that way.

But what about this? Filters? What if we only want to show items in a Collection List that have a rating of 4 or higher? If we're using integers, we can simply add a filter where we specify that the Number — our rating — is greater than 3. That means anything that's 4 or 5 on that rating will show up on our list. What about going back in and changing it to less than 4? Now only the items rated 3 and below are showing up. Or, maybe we only want to show the best-rated items. We could specify that we want the Number to equal 5. Now only items rated 5 show up.

So. Numbers can do a lot. Similar to a Plain Text field, we can enter Numbers and decimals. But we can also use these Numbers to sort. And create filters and sorting rules that let us organize and display selected content in our projects.

Related tutorial

Number field

1:27