Home › Forums › General XMetaL Discussion › Different stylesheet for ‘Tags On’ and ‘Normal’ view? › Reply To: Different stylesheet for ‘Tags On’ and ‘Normal’ view?
Reply to: Different stylesheet for ‘Tags On’ and ‘Normal’ view?January 3, 2012 at 7:55 pm
The DocBook example is pretty complex. It loads a JS file instead of putting all code directly in the MCR and does a few indirect things like using JScript prototypes, so it might be hard to decipher if you aren't familiar with those concepts.
For that reason I've created the simplest possible example I can think of to make it easier to understand how to do this. All code is in the MCR file. See attached zip.
The one thing my example doesn't do is write out the CSS to a file for use with Page Preview (Browser Preview). If you need that to continue to automatically generate XSLT for you (to transform to HTML for previewing) as it does when just a CSS file is being used you need to write out your CSS to disk (the control CSStoXSL.dll that generates XSLT needs to read from a file). Lots of customizers don't expect their users to use this feature, or they provide a hard-coded XSLT file so you might not need it. If you do, code that demonstrates how to do that is included with the previously mentioned DocBook demo, search for “deployPreviewCSS”.