Building a component to react to Custom Content
Hello all,
Been a while since I've asked an odd question - I'm looking at building a component to access a specific Custom Content, and then decide whether to show the component and how it should be displayed. This is decided based on the FreeMarker placed in the Custom Content box (to allow changes without having to re-write the component itself).
I know how to pull the Custom Content box from Admin and display it, I'm just curious if there's a way to make the component check the code within the Custom Content box, and then decide whether or not to display it?
Here's more of a breakdown of my train of thought:
Component - checks if users.role matches to anything with the Custom Content field. If the user's role isn't listed in the Custom Content text then the component will not display.
Custom Content - dictates the HTML to be displayed based on the users.role, which is checked within the Custom Content text.
I hope this makes sense - any suggestions gratefully appreciated.