CMS list link can link to collection page only if a switch field is on

I have a project CMS list. and if a project is switch on (featured) is able to list it’s owm colleciton list page. I didn’t make a button, I made entire card as a link (link block)
is there a setting or code I can learn?
or should I make a link block as transparent, and visiable if the featured is on?

here is the project list page :
https://shungkei.webflow.io/projects

thank you

There isn’t an easy way to conditionally add a property to a containing linkblock, but you should be able to do this with a component.

  • Create your card as a component, and give it a link property. Default it to # ( unlinked ).
  • Bind that property to your outer link block.
  • In your collection list, drop TWO copies of that same component
  • The first one should be visible only if there’s a link property set, and you then bind that property to the component so it carries through to the link block within.
  • The second one should be visible only if the link property is NOT set. Here you don’t bind the property so it defaults to #, which is effectively unlinked.

There are a few variations to this approach, such as placing the link block external to the component, but I prefer having as much in the component as possible.