Now that I have figured out the linking issue with the component, I’d like to know if there is a way to have a colour change on the text on hover depending on the chapter. for example chapter 1 tiles to orange, chapter 2 tiles to yellow etc
Right now changing the interaction changes all the tiles and the only other way I can think of is duplicating the actual component and interactions
Yes, but unfortunately components don’t explicitly have style support yet, so it’s a bit of a hack.
I’d probably approach it like this;
Replace the outer div of your component with a custom element. Make it a DIV. Add a custom element property of “style”.
Then data-bind that style element to a component property named “Style”. That way you can just define a style string for each instance, and it will apply to that outer DIV.
In the CMS, add a Style text field
Data-bind your component’s Style property to that CMS field.
Now in the CMS you can do whatever styling you want to your item-bound component instances, e.g.
color: red; would make inheriting text red
color: purple; background-color: yellow would add color to the background of your div also
How you’ve setup your inner elements will matter, for example if you set a color to your text element inside of the component, it won’t inherit the color from the parent DIV.