CMS, Layout & Design

CMS Update: Index Variable

CMS Update: Index Variable

CMS Update: Index Variable

Edo

·

5:47

·

10K views

·

About this lesson

We’re excited to introduce a new Index variable for CMS lists, unlocking layout options that weren’t possible before. You can now make the first card span two rows or two columns in a grid for a more dynamic look. This addition also enables conditional component variants based on item position, letting you alternate between left and right-aligned cards, or switch between filled and non-filled backgrounds. Lastly, this update gives you precise control over layout details, like showing dividers only between items. This release also includes fixes, improvements, and other additions.

Example project showed in the video: https://cms-layouts.framer.website

Update page with all improvements: https://www.framer.com/updates/cms-index-variable

Sign up: https://framer.link/yt

Follow: https://framer.link/yt-x

Learn: https://framer.link/yt-academy

0:00Hi everyone, this is Edo from Framer.0:02Today I'll show you how to create0:04flexible CMS layouts thanks to a new0:06variable like having the first card span0:09two rows in a grid for a more modern0:11look or having it span two columns0:14instead. You'll also learn how to change0:17component varants based on item0:19position, which also unlocks the0:20possibility to alternate left and right0:23cards or switching between field and0:25non-field backgrounds. Lastly, we'll0:28cover details like showing dividers0:30exclusively between items. I've also0:32added a remix link in the video0:34description so you can dive into this0:36project yourself. But now, let's get0:40started. Here I have a simple grid with0:42content coming from the CMS. And if I0:45select the first item, you'll see I have0:47a columns and rows property. By the way,0:50if you don't see the rows property, make0:53sure that when you have the grid0:54selected and you go into the advanced0:57layout options, you have the height of0:59the item set to1:00fixed. If that's the case, when you1:03select the item, you should be able to1:06see this rows property. And now I'm1:08going to simply click the plus set1:11variable and see there is this new1:13property called index. And then I'm1:16going to select equals. And now when the1:19index equals and I'm going to set one,1:23I'm going to have a span two. And as1:26simple as that, you'll see that this1:29item is now spanning two rows. Now to1:33show you how flexible this is, I'm going1:35to change the value of the index to1:38something else like 2 3 4 etc. And this1:43essentially tells which position has to1:46update its card. Super1:50powerful. Now let me show you another1:53example. If I go over here in the second1:55page I prepared, there is another grid1:58and this time I want the first item to2:00span two columns instead of rows. Now if2:04I go over here, I see the columns2:06property. I hit plus and just as before2:09I do set variable index and then equals2:12bring it to one and then say span to2:15when yes and just like that you see that2:18the first card is the one to be featured2:20but you can also make it the second the2:22third and so2:24on. Now let me show you another2:27example. With this example I want to2:30show you how powerful the index variable2:32is in combination with component2:34varants. Here I have a component on top2:37of the list with a default variant and a2:40feature one and I want to use this2:43feature variant for the first article in2:46the list so that when there is a new one2:48it has this featured look. I can go here2:51and with the first item selected then I2:54go to the variant property hit the plus2:57set variable and go to our index3:01variable. Here I want to set equals3:04again and then set one and when yes I'm3:08going to choose the feature variant and3:10just as easy as that you'll see that the3:13first item is going to be featured with3:16his own card and again I can decide to3:19feature other positions in the list as3:22well if I want. Now I'm going to show3:24you another example and this one is3:27particularly interesting because it3:29unlocks an entirely new type of layout3:32that was not possible before. Here I3:35have the first item as a component3:38again. So I have the primary variant3:42which has the image on the left and the3:44right variant which is an image on the3:47right. Now if I go back I can go to the3:52variant property and hit plus set3:55variable index and this time I'm going3:58to select is odd.4:01Now this means that when the variable4:03index is odds there is a conversion that4:06is going to happen and when yes I'm4:08going to leave the left variant and when4:11no I'm going to set the right variant4:14and you'll see that there is this very4:16nice alternating layout which is very4:18useful for things like featured sections4:21of your4:23site and I'm going to use the same4:25technique for this other example in4:27which I want the item background to be4:29filled on not filled depending whether4:32their position is even or odd in the4:34list. I'm going to do that by setting4:37the index variable and then again is odd4:40and then when yes filled when no not4:43filled. Then you see a really nice4:45effect immediately4:47applied. Lastly, a nice little detail4:50about dividers that you can now fully4:53control when to show and when to hide.4:55Here I have two variants, one with a4:58divider and one without. And in the list5:01if I select the first item and I add an5:04index variable like before and then set5:06it to equals one, I can pick no divider5:10exclusively for the first item so that5:13is only shown in between5:16items. And this is about it for the5:19index variable. This update brings a lot5:22of other improvements to the CMS that5:25you can check in the updates page. And I5:27also remind you, you can remix this file5:29I just showed you so you can dive in5:32yourself. I'll see you next time and5:35happy building.5:38[Music]

Watch on YouTube ↗

More in this topic

Framer Update: CMS 3.04:13
Framer Update: CMS 3.0
Framer Update14K views · 1 month ago
8 Framer shortcuts you're probably sleeping on4:19
8 Framer shortcuts you're probably sleeping on
Layout & Design3K views · 2 months ago
Framer Update: Stack Sorting and Bento Grids2:16
Framer Update: Stack Sorting and Bento Grids
Framer Update7K views · 2 months ago
Sharing Vector Sets Across Projects (Vectors Lesson 7)3:41
Sharing Vector Sets Across Projects (Vectors Lesson 7)
Layout & Design1K views · 3 months ago
Connecting Vector Sets to the Framer CMS (Vectors Lesson 6)3:38
Connecting Vector Sets to the Framer CMS (Vectors Lesson 6)
Layout & Design2K views · 3 months ago
Ship websites with enterprise needs, at startup speeds0:33
Ship websites with enterprise needs, at startup speeds
Announcement8.3M views · 3 months ago
Animating Vectors in Framer (Vectors Lesson 5)4:25
Animating Vectors in Framer (Vectors Lesson 5)
Layout & Design4K views · 3 months ago
Customizing Vectors with Variables in Framer (Vectors Lesson 4)4:59
Customizing Vectors with Variables in Framer (Vectors Lesson 4)
Layout & Design3K views · 3 months ago

Create a free website with Framer, the website builder loved by startups, designers and agencies.