Because working with static stylesheet files on a IBM WCM 8 project can be tedious, in this post I will share an easy way to enable the use of the draft version of a stylesheet in WCM, allowing you to preview the changes you're working on in the WCM project.
Let say you have a stylesheet as a piece of content and it is called inside a common HTML - Header component. You probably have something like:
Additionally, you are working in some improvements on your portal and those improvements involve making some changes to that stylesheet. In this case, you simply add the stylesheet to the project, update it with the changes/corrections/improvement and preview the project and....wait, where are your changes? Why WCM still using the current published version of your stylesheet and not the draft version??
My teammate Iván Santiesteban and I discovered that by default IBM WCM 8 will not use the draft version of the stylesheet that you are working on in the project when you try to preview it. So, if you want to preview the modifications made to the css stylesheets all you need to do is modify the reference to the stylesheet (the draft version) adding the following variables in the href parameter:
These changes will allow IBM WCM 8 to call the draft version of the stylesheet when you preview the project you are working on.
Don't forget: when you are ready to publish the project, remove the HTML Component and cancel/delete the draft, since it was used only to test the changes on the stylesheet.
To summarize, the process is:
- Add the Stylesheet to the project
- Add the HTML Component to the project
- Edit the HTML Component to reference the draft stylesheet
- When you are ready to publish the project, remove the HTML Component and cancel the draft