Set required field in CMS collection only *if* an other field is filled

Scenario: Imagine a blog layout which has a featured blog at the top with a large hero image, then other normal blog posts underneath that don't have any image at all (just text). In the CMS I add a Featured switch, and a Featured Image. Now, if the blog post is marked as Featured, then the Featured Image is a required field (can't have the hero blog post show with no image), but if the blog post is a normal blog post, then the featured image is not required.

Having some type of ability to dynamically set required field would be very handy.

  • Overlay
  • Apr 19 2018
  • In backlog
CMS
  • Admin
    Webflow Team commented
    July 30, 2018 20:44

    You can just set all fields to not be required, then use the conditional visibility in your design:

    https://university.webflow.com/article/conditional-visibility

    - Nelson, Customer Success Specialist

  • Overlay commented
    July 31, 2018 02:35

    Hey Nelson, thanks for responding, although your suggestion doesn't solve this problem and perhaps my initial scenario description wasn't clear enough.

    My request is specifically around the CMS and management of a client. The whole point of setting a field as required is to ensure a certain level of quality and consistency in an environment where the client can post pretty much anything they want (blogs for instance). That's why in the above scenario you would definitely want to "force" the client to upload a photo for any featured blog post.

    However, in situations where no image is required (in the above scenario that means any standard, non-featured blog post), it seems redundant and unnecessary to force the client to upload an image for every single blog post only for it to not be displayed.

    Of course there are workarounds for this at the moment. You could simply make the image field mandatory (annoying for the client). You could make the image field non-mandatory and just constantly double check there are no "blank" featured posts, ruining the design of the page (annoying for the designer). Or you could create two seperate CMS collections, one for standard blogs and one for featured (removes the ability to quickly change a blog post from standard to featured, again annoying for the client). However I do hope that a better and smarter solution gets implemented one day.

  • Admin
    Webflow Team commented
    August 03, 2018 23:30

    Hi there,

    Thanks for the clarification.  This is actually an idea we may be able to work on.  For now, I'll place this in our "backlog".

    Cheers,
    Nelson

  • מאיר רביב commented
    26 Aug 06:56

    Great IDEA!