Pages

Thursday, December 8, 2011

Managing JS CSS XML as content classes in 10.1

Problem

Management Server treats all page instances as HTML pages and like to search for <head> and <body> tag to inject javascript code into them.  The issue is most noticeable in version 10.1.
If <head> and <body> tag are not found, MS injects those tags along with javascript snippets to the top of the page.
For CSS and JS pages managed in MS and linked via anchor, this invalidates the CSS and JS, hence user would notice some CSS styles not being applied, and JS library/function not loaded.

Solution

Include this code at the bottom of any CSS or JS content class that have page instances referenced/connected via anchor in NOT Publish Mode to avoid invalidation.
/** <html><he<!IoRangeNoRedDotMode><!/IoRangeNoRedDotMode>ad></head><body></body></html> **/

2 comments: