- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Whose got 2 thumbs and is horrified every time they look at the Microsoft Word Generated HTML? This guy right here. Knowing full well that pasting from Word is a fast and simple method for knowledge creation, I am shelving my complaints about Word's HTML generation to look to a way to help people work within their comfort zone.
Here was the issue:
I just spoke to a customer that was seeing STYLE declarations and CDATA code in their Knowledge search results, both in the system global search and the CMS search results page. Very clear that this code had to be abstracted from the document itself and referenced as a CSS file within a theme. It just makes sense to declare the styles once, and reference the style sheet once.
Here was what I did to fix it:
1.) I copied the entire set of CSS rules at the top of the Microsoft Word generated HTML in all of its poorly formatted glory, then pasted it into CSSEdit ( a CSS authoring tool that is a must have for any serious CSS designer) and selected "Re-Indent With Spacing declarations" from the format menu section and the result was a beautiful, well formatted CSS file. At this point I am extremely happy, I validate the CSS and know now that I can add it to a theme in the CMS.
2.) Understanding how knowledge articles are rendered helps decide where to apply the CSS i just brought over from the Word doc. Because articles are rendered on a single CMS page, it did not make sense for me to just add the CSS to the "Default" theme and apply it to all other pages in the ESS Portal, just the knowledge article detail page. In layman's terms, the knowledge article id is passed into a detail page ( in this case - knowledge.do), for further explanation, you can reference "content types" in the WIKI. Pretty cool that I can apply a completely different theme to any page within a site, I have found it to be a useful function of the parent / child relationship at the heart of "Site" defaults and their "Page" children. Always a good rule of thumb to keep the theme references on the page level clear, unless you need them.
3.) I created a new theme called "Default - Knowledge Article", clicked the edit button to bring in all of the existing site CSS files which are part of the "Default" theme, and just added a new file with my formatted CSS and called it "MS Word Knowledge Styles". Once that was done I applied it to the knowledge article (URL - knowledge.do) detail page.
There you have it. It worked and I think was a clean way to handle a potentially messy situation, at least the CSS portion of the markup. The only issue I would see was if all of the articles came from articles that did not use a consistent style template. If this is the case then you should probably cleaning up the documents in Word first and have them use a single temple just to be safe.
- 757 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.