Paste Script Demo
With OpenCms 8 you can paste scripts like Facebook Like Button directly into xmlcontent editor fields, by defining a special area inside of the formatter.
Define two different content areas inside of the element formatter using ${cms.edited} variable. The part of the html code containing the pasted scripts will be displayed, if the page is reloaded. If the element is edited or moved, the html part without scripts will be displayed as alternative. In that case the user can be reminded to reload the page.
Please see following formatter for implementation details:
/system/modules/org.opencms.dev.demo/formatters/article/no_script/center.jsp
Facebook Like button
This button is added with iframe.
Facebook Like button
This button is added without iframe.