Hello,
I am looking for what is the best approach to let the author add meta tags (or even custom js and css scripts) to the HEAD html section of an Adobe AEM page.
What are the possibilities?
Thank you.
Views
Replies
Total Likes
with meta-tags do you mean "tags" (as the feature provided by AEM ootb) or a more free form field? When you add tags in the page properties, they are typically added to the HTML head section (depending on your templates, but that's a very common approach also used in the examples).
Regarding custom JS and CSS: You can do it (add a free-text form into the page properties and insert it at the right place into your page. Having this is typically a sign of bad planning and bad design. From a pratical point of view it's often misused, and you end up with broken styles and debugging issues you haven't coded, but someone found "cool". I wouldn't implement this.
Views
Replies
Total Likes
I would design something like this
Meta Tags :
The meta tags are content authorable and we don't know how many meta tags the content author would add, so it is good practice to create a separate tab called SEO or meta tags in the page properties and add a multifield control
Another advantage is you can configure this at the local page level and inherit to child pages without re-authoring on child pages
CSS and JavaScript :
It is not good practice to keep JavaScript or CSS directly in the page properties, instead of that what you can do is place all your CSS and js files in the client libs and load those in the page properties
You can keep path field in the page properties and let the author or superuser allow him to choose the clientlibs to load for particular page o or a particular site.
Views
Replies
Total Likes