Paste Script Demo

With OpenCms 8 you can paste scripts like Facebook Like Button directly inside of your content, by defining a special area inside of the formatter.

Define two different contents areas inside of the element formatter using ${cms.edited} varible. If the page have been reloaded the part of the html code containing the pasted scripts is displayed. If the element have been edited or moved the alternative part of the html without scripts is displayed. 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.