Dynamic Style Settings for adding plain text as a class to a div

When I build websites in Wordpress of Craft, I often add conditions or href links to specific ID's or Classes in a collection or for loop. When needing to target specific divs (for revealing or specifying particular divs via js for example) it would be great and very beneficial to add text to each item in a collection. Let's say you want to specify which day a specific menu item shows up, that every Monday it shows up via js. It would be great for a rich text field to have a wrapper with the specific text as a class attached to it. So based on a choice field it would add the tag to that particular item. I know you can basically do this with the html embed. But that means we need the html for the entire item, not just the wrapper. 

  • Nathaniel Perales
  • Feb 27 2020
  • Reviewed