I'm new to the details of AEM. I work on the Marketing side of our website so I make lots of one off landing pages and campaign Hero Sections that the Authoring WYSIWYG can't handle (I can't seem to do pixel perfect with a WYSIWYG). Is it best to just create a component for the page or section that needs custom HTML, CSS, and JS? Or is there another way that is preferred? It seems like the components will pile up pretty quickly this way.
Solved! Go to Solution.
Views
Replies
Total Likes
You can use embedded core component to copy-paste html but for js and css or you can create similar components to inject HTML/CSS/JS
https://www.aemcomponents.dev/content/core-components-examples/library/page-authoring/embed.html
You can use embedded core component to copy-paste html but for js and css or you can create similar components to inject HTML/CSS/JS
https://www.aemcomponents.dev/content/core-components-examples/library/page-authoring/embed.html
You can always use HTML Markup editor mode in richtext component to paste HTML snippets. The disadvantage is that the edits on it are not a marketer change, but a developer change. But, as said, if they are one-off sections, this should suffice
Views
Replies
Total Likes
In AEM richtext component, you can add HTML but scripts are not allowed as soon as you save, it will remove script tags. Its due to security rules in CORS configuration that can be update not sure if it will still allow scripting tags though.
embed is an option to be considered if CSS and JS required that are not already part of your component designs.
Views
Replies
Total Likes
I think, before jumping into creating mega component one-time-use components, we can do something better. Let's think about cutting cost, enabling reusability and flexibility.
If we can strategically create components to shape up the marketing team's landing page, their team can be the ones who create the pages themselves, and since the marketer's components are flexible and robust, they should be able to add styles to whatever their heart contempts.
But... if you really need to create that mega component one-time-use component, then is my suggestion:
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies