Finnsweet Dynamic CMS for the main blog (rich text field)
Clickable text fields that pull content from the FAQ field in the CMS, which are set to invisible if there’s no FAQ
I’ve tried using Finnsweet instances to no avail, it will create a TOC for multiple div blocks using instances without a problem, but every time I throw a rich text field into the mix, it just won’t do it lol. So I’ve had to do it this way.
My issue is, the TOC for the FAQs are still creating links to the invisible FAQs, which isn’t really the best for SEO. I would rather the links not be created at all if there’s no FAQ. Is this possible?
Personally I’d take a different approach. If the number of FAQs is variable, I might go-
Affiliated FAQs collection which orders and links FAQs. Use a collection list to display them, and it won’t generate extras. No code, but more complex data.
Rich Text field for FAQs, then JS to parse and build the accordion, and the nav. Keeps things clean and simple at the data level, tradeoff is code.
If you really want to keep them as individual CMS fields, you could add an additional switch field, Show FAQ 1, Show FAQ 2, …
Boolean CMS fields can be mapped to component visibility props which mean that if you create a component for your FAQ ToC item, and for your accordion item, you can use that switch to fully suppress the HTML rendering.