Framer Update, CMS

CMS: Conditionals and Transforms

CMS: Conditionals and Transforms

CMS: Conditionals and Transforms

Benjamin

·

8:40

·

21K views

·

About this lesson

This Framer update adds Conditionals and Transforms to the CMS, unlocking a new level of control over your CMS content. Remix the demo project: https://flix.framer.wiki/

🌞 Try Framer for free: https://framer.com

🎉 Follow on Twitter: https://twitter.com/framer

💎 Join Community: https://www.framer.community

#website #framer #cms

0:00yo my name is Benjamin and in this video0:03I'm excited to introduce two brand new0:06CMS features called conditionals and0:09transforms these features unlock all new0:13use cases and allow you to do much more0:16with the data in your CMS collection and0:19I have prepared this little demo to show0:21you three examples in our little0:24collection here we have a bunch of movie0:27reviews0:28we have a title a date a movie poster0:32and here we have a few fields that are0:35not shared across all items not all0:38items have a YouTube link and not all0:40items have a banner image plus we have a0:44rating per movie and a tint color per0:47movie as well and you can see all of the0:50fields over here as well and let me open0:53the first one so you can have a quick0:55peek at how the data is populated for0:58this movie we have a poster a YouTube1:01link but no better image and then a1:04rating tint and our review paragraph so1:07let's start with the first example I'll1:10open up one of the detailed pages and1:12you can see our first issue right here1:15as you have seen in our collection here1:18we have a YouTube link for this movie1:21review but we don't have a banner image1:23this is a very common setup we want to1:26conditionally show and hide a leading1:29asset so what's happening here is that1:31our movie Banner correctly has the fill1:34assigned to the banner variable from the1:37CMS but for this specific item the1:41banner is not set in the CMS at all so1:45for this page we do not get an image1:48from the CMS at all and that's why you1:50see this blank frame now traditionally1:53you would have to add a toggle variable1:56to your collection and Define it for1:59every single item in the CMS with this2:02release this is no longer necessary and2:05there is a much easier way with the2:08movie Banner selected I can head over to2:10the visible property click on it and I'm2:13now presented with a menu of conditions2:17so here we can say only set visible to2:20true if the banner is actually set in2:24the CMS collection so this is our new2:27condition UI AI you can see in the2:30property panel that visible depends on a2:33condition the variable used for our2:36condition is the banner and the2:38condition we're checking for is whether2:41or not the banner is set in our CMS so2:45while things look good here let's check2:47the next detail page2:50here you can see we still get the banner2:53image so our condition works both ways2:56however on this page we do not get a2:59YouTube link from the CMS so we don't3:02want to display a video we only want to3:05display a banner image so again I can3:09head over to the visible property in3:11this case I want to check if the YouTube3:14variable is set in the CMS collection3:17so I'll add the is set condition there3:22so the condition is right but we added3:24it to the wrong layer as you can see in3:27the layer panel our video is actually3:30wrapped in a little stack so we want to3:33be sure to apply our condition there3:36undoing or deleting conditions is very3:38simple in our case I can simply hit3:41command Z to undo it I can then select3:44the parent stack and apply the same3:46condition there3:48so I'll head over to the visible3:50property select the YouTube variable and3:54check whether or not it is set3:57and as you can see the YouTube video is4:00now properly hidden on this page4:03and if we go back to the first page the4:06banner image is still hidden and the4:09YouTube video appears so we've now4:11correctly added our conditionals and by4:15using these new features we did not have4:17to add any new fields to our CMS4:20collection we now have control over4:22which content displays on which page4:25simply by editing our CMS4:29that's it for the first example let's4:32now continue to the second example where4:34we take a look at how we can add a4:37transform to text4:39above each paragraph We have this little4:43title that says review4:45but it's the same for each item in our4:48collection ideally we could reference4:50the movie title here as well this4:52release also adds the ability to4:55transform text in this case we could add4:58suffixes and prefixes to existing5:02variables so first I can pull in the5:06actual Title Here by referencing the5:09title variable5:11this is the same thing we do over here5:13to add a transform I'll click on content5:16and then hit add transform and I can5:19select a prefix or suffix5:22here with the suffix selected we could5:25add any copy at the end of our variable5:29and this will say lock review I can also5:33switch this to be a prefix allowing us5:36to type something in front of our title5:39variable like maybe movie review and5:42then the title I think I prefer the5:44suffix but I want to highlight that you5:46can also chain your transforms in other5:50words I can add another prefix here so5:53we can really construct a little5:55sentence around a variable5:57and now we have applied both a suffix6:00and a prefix to a single variable this6:04is a very flexible and Powerful concept6:07that allows you to get really creative6:09with your CMS content for this demo I6:12think the suffix suffices so I'll remove6:15the prefix and that's pretty much it for6:17the second example here6:19I can cycle through a few different6:22posts to see that all these titles are6:26working correctly6:28with our transforms in place let's have6:31a look at our third example I'll go back6:34to the index page6:36and I would like to add a little badge6:39next to each title if the rating equals6:435 stars6:45as you can see we currently have two6:47movies that we have rated 5 stars6:51I have already created a little badge6:53let me bring that back6:56there we go so now we have this little6:59batch that appears on every single item7:01within our CMS collection list7:04so how would we go about doing this we7:07know we have the rating number in our7:10CMS collection and we have this little7:13badge in our collection list so the7:16condition we're after is checking if the7:19rating number equals a certain amount we7:23only want it to be visible if the rating7:25equals five so with our condition added7:29I can start cycling through the values7:32and as I do so notice how the batch7:35starts appearing behind each movie title7:39that has the same rating and with the7:43value set to 5 we now have the batch7:45showing up correctly only for the movies7:48that have 5 star ratings with these7:51conditions we're essentially adding7:53little bits of logic to our CMS pages I7:57think this is super cool as it allows7:59you to do so much more with your CMS8:02content in framer if you would like to8:05try some of these new features yourself8:07I'll be sure to include a link to this8:10demo project in the description down8:12below that's pretty much it for this8:15video we hope you enjoy this CMS update8:18thank you so much for watching and see8:21you in the next one

Watch on YouTube ↗

More in this topic

Framer Update: Logo Shaders2:05
Framer Update: Logo Shaders
Framer Update12K views · 1 month ago
Framer Update: CMS 3.04:13
Framer Update: CMS 3.0
Framer Update14K views · 1 month ago
Framer Update: Holo Shader1:46
Framer Update: Holo Shader
Framer Update6K views · 2 months ago
Framer Update: Auto Translate3:09
Framer Update: Auto Translate
Framer Update4K 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
Shader: Chromatic Aberration1:56
Shader: Chromatic Aberration
Framer Update7K views · 2 months ago
Framer Convert5:42
Framer Convert
Framer Update13K 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

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