Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

CityDesk Articles With CSS

I find myself in a situation where I am frustrated with what I perceive to be a lack of an elegant integration with CityDesk's article editor and CSS.  I have an external stylesheet and the CityDesk article editor has zero awareness of the styles defined in that stylesheet.


1) An article is written in MS Word, with various fonts, font sizes, italic, bold, indented quote blocks, and bulleted lists.

2) Copy and Paste the text from Word into the "Normal View" in the article editor.  All the formatting is retained.  Very nice.  When I saw that CD had this feature, it was one of the things that sold me on it--people deliver articles to me in MS Word format.  From there I want to publish them in both PDF form (which is trivial from Word) and to the web.  CD looked like the tool that was going to enable me to do the latter.  Now I'm not sure sure (keep reading).

3) Switch to "HTML View".  You see <FONT> tags, <I>, <B>, etc. etc.  Yuck.  I have pointed this article at a template, that template is in turn pointed to a style sheet file, which is already loaded into CD.  Why does there appear to be no awareness of this fact in the CD editor?

What CD needs is something that allows me to map formatting in the Normal View to styles within my style sheet.  For example, give me a way to tell CD, "When you see 11 pt Verdana, use the 'span.standard' style, which you should find in the stylesheet that this article's template is using." or "When you see italics 11 pt Verdana, use the 'span.italic' style."

Without something like this, I am going to have to either edit all of this auto-generated HTML by hand to convert '<FONT style="FONT-FAMILY: 'Arial','times new roman'" color=black>' into '<span class="standard">' or I'm going to have write some scripts or a program to do this for me:

1) Paste from Word into Normal View
2) Switch to HTML View
3) Ctrl-A, copy the HTML the clipboard
4) Paste the HTML into an editor, custom program, whatever that will search for <FONT> tags and whatnot and replace them with the styles I want
5) Copy and paste the new HTML back into CityDesk
6) Hope that CityDesk does not mess with my customized HTML.


Am I missing something?  Is there some cool feature or technique that will help me?

I read the entry in the help file that says that CityDesk will apply style substitution to html tags, but this does not seem flexible enough.  The example in the help file says you can define an inline style such that a certain tag will be replaced with a certain style when CD publishes the site, but this does not appear to be designed for sensitivity to where in a document a tag is being used or what attribute values the tag might have in different parts of the file.  What I mean is, I don't want to globally replace all <I> tags with the same style in all instances.  In one case it might need to be 11 point Verdana italics and in another case 10 point Courier New italics.

If anyone can give me any guidance, it would be greatly appreciated.

Dan Read

Daniel Read
Friday, May 2, 2003

Try "Paste without formatting" to paste the text from word without all the word gobbeldy-gook.

Michael H. Pryor
Friday, May 2, 2003


CityDesk uses the DHTML Edit control that comes integrated with IE. This is the same HTML editor you see on sites like eBay, and with other browser-interfaced content management systems.

So when you copy/paste from word you're going from Microsoft to Microsoft... and we all know how bad MS's implementation of HTML is. You're basically getting MS Word formatted text in CityDesk when you copy/paste.

I was in a similar situation as you for a while, and I believe I used a combination of Word's export to HTML, Dreamweaver's "Clean Up Word Formatting" and BkReplacEm from . BKReplaceEm lets you run regular expressions on files. The good thing about it is it lets you keep the regular expressions from session to session so you're not repeating yourself.

So what I'm saying is, CityDesk is a CMS first and an HTML editor second. HTML editing simply isn't it's core competancy.
Friday, May 2, 2003

Michael - I often find myself copying/pasting into notepad & then copying that and pasting that into CityDesk... It's quick and dirty and it works, but then you have to go reformat the document.
Friday, May 2, 2003

Hello, Michael.  Thanks for your response.  I appreciate your suggestion, but using that feature would defeat my goal: I *want* the formatting from Word.  If I've got an article that is several pages long, written in MS Word, with all kinds of specific formatting throughout.  I do not want to have to go back through the entire article in the HTML view and insert styles or replace tags with styles everywhere the original text had italics, bold, font changes, font size changes, block quotes, bulleted lists, etc.

That would take me hours, and one of the main reasons I bought CityDesk was to be able to paste stuff in from Word and keep the formatting.  CityDesk appears to do a good job of keeping the formatting, but it does not appear to do this in a CSS-aware manner.

Perhaps I am asking too much.  I'd like to have my cake and eat it too.  :-)

Thanks again,

Daniel Read
Friday, May 2, 2003


Thanks a lot for your response.  Thanks especially for the tip on BkReplacEm--that will keep me from having to write such a tool myself.

I think I will try exactly what you suggest, with the exception that I'll probably try HTML Tidy since I don't use Dreamweaver.  I believe they have a module that cleans up MS Word HTML.  All of my articles use a standard template, so there will only be so many tag-attribute strings that I will have to create regular expressions for in BkReplacEm.  It's not great, but it seems livable.

Perhaps I need to look at another avenue, though, for the format the articles are first written in.  I've been using Word because using's Word-to-PDF converter creates such attractive PDF files.  A significant percentage of my readers prefer to read the articles in PDF format.  If the articles were written HTML or XML in the first place, I could convert the HTML to PDF--but I just don't think the resulting PDFs would look nearly as nice.

Thanks again,

Daniel Read
Friday, May 2, 2003

You're right. Unless, of coures, you imported the HTML into Word and then printed it. Then it wouldn't look like a webpage anymore. I don't know if it would break your CSS formatting though.

I'm not familiar with the tool you use to make PDF's... I just use Adobe Acrobat. Is there nothing that will take a raw .html document and turn it into a PDF? Then you could just output a "printable" version and PDF that.

Are you creating these articles yourself, or are they being given to you by someone else?
Friday, May 2, 2003

Have you tried the "export to compact HTML" addon for Word? It's on the MS site somewhere and produces somewhat better HTML than cut/paste.

To make PDFs from Word, I use Jaws PDF maker - it came on a magazine cover disk, so not the latest version, but  perfectly adequate. It also installs a virtual printer, so you can make PDFs from web pages.

Michael Wild
Friday, May 2, 2003

Thanks, Michael, for the suggestion on that add-on.  I might try that as well, but I wonder if it might still need cleanup, and if it did, whether Tiny HTML would have the right stuff to clean up the "compact" HTML.  I'll probably mess around with all this over the weekend, and when I ultimately get some kind of methodology worked out, I'll post it up here for the sake of posterity.

As for how I make the PDFs, I use this site here:

It's free, and it works pretty well.

Also, Mark, up until this point, I have been writing the articles myself.  I write essays, book reviews, and other stuff about software development and publish them at my site developer.* (  I'm in the process of doing two things: one, converting my entire site (about 60,000 words of content) to CityDesk and a whole new look-and-feel from another similar product that I have been using for the past two years, and two, transforming the site from a place where I publish my own work to a web-based journal where I will regularly publish the work of other authors as well as my own.  This page on my site describes what I'm working towards:

So going forward, not only will I be publishing my own articles, but those that people send me.  Sometimes these will be in a nice format, sometimes they will just be text or html that I will have to format myself.

Thanks again for your input, Michael, Michael, and Mark.


Daniel Read
Saturday, May 3, 2003

Are you sure CityDesk is the right tool for you? If you're really going to open up the site to other authors, a completely online tool may suite your needs better.

Surely people can input plain text with the occasional vBulletin or HTML tyle bold tag. It sounds like you're setting yourself up for a lot of work when the process can be automated.
Saturday, May 3, 2003

CityDesk may not at this point be the perfect tool for me, but from all the shopping around I've done, it's the closest thing.  There are two other features that CD has that are key for me: first, the use of templates, which allows a single change to one file that can be propogated to the entire site; and second, the fact that it publishes the entire site en masse to static HTML files.  So many products use some kind of article.asp?id=8765322 type paradigm with the site, and I really don't like having those kinds of urls.

I'm hoping that someone at CityDesk is reading this forum and is working on a new version that will have a better article editor that is more tightly integrated with CSS.  It seems that Fog Creek will have to do this soon, since what serious web developer wants to put out a site full of <FONT> tags?  (And even for those that do, the article editor in "Normal View" does not even let you choose a font!)

In the meantime, if it takes a little while to properly format and publish a new article, I can live with that.  I just don't think the ideal solution for me exists on the market right now.


Daniel Read
Saturday, May 3, 2003

Daniel, you say there are two key CD features:

-the ability to propogate a single change to the entire site.
-the ability to publish the entire site en masse to static HTML files.

With respect to the second key feature - is it really the ability to publish to static files, or the ability to link to a "normal" URL that you are looking for? (These are not quite the same, and I found myself wondering.)

Monday, May 5, 2003

this worked for me i thought id pass it on
free money from paypal?

First how to make thousands of dollars in cash overflowing your paypal account.

PLEASE do not pass this up now!!
I thought you might
be interested in making some extra free money alongside
of what you are already doing. After all, we could all use
some extra income, no matter what we do!$! How does $20,000
in two weeks sound? It IS possible...
Maybe you have seen an older version of this $5 letter going around,
but WHAT IF you haven't seen this NEWEST version??
WHAT IF you don't SAVE THIS LETTER...then the idea has
time to sink in and you realize THIS VERSION is SIMPLE,
CHEAT PROOF, LEGAL, and SPAM FREE!! Finally a proven method
of making extra money on line! SAVE THIS EMAIL!!
If you are already working a home business, you can do this one along
with it. If not, this is the easiest way to earn $$$ online that you've
ever seen! Just be sure to read it all...take your time, come back to it...
go over and over it, you won't be sorry.
WHAT IF I share with you a way to make some fast and easy cash, using
a copy of this letter and the simplest Internet Payment System around?
You have most likely seen or heard about
"The Letter" $5.00 program that was recently televised
on 20/20, OPRAH WINFREY, and an article published in the Wall Street
Journal on 6/16/2001. If not, here it is!!
WHAT IF it took only a half hour to set it up? Even if you are already
in another program, stay with it, but do yourself a favor and
DO THIS ONE as well.
There is NO LIMIT to the income you can generate from this business!!
You can do it over and over again, ANY TIME you need extra income.
Please read all of this, right to the very last sentence.
If you don't have time now, then SAVE THIS LETTER, and read it later.
Everyone has heard about " PayPal" ( if you haven't you will soon)
and, when I came across this concept I knew it
would work because, as a member of Pay Pal, I had
already experienced their efficiency and excellent standing.
PayPal is the simplest method of making and receiving payments online
anyone has ever seen.! Anyone with an email address can join, for FREE!
Please read further before you go there...
You can complete this whole process in less than one hour and you
will never forget the day you decided to do so!!! Oh!
Did I say FAST? By fast I mean 'the speed of the
Internet-type fast.' Everything is done on the
Internet by E-mail. And, if you abide by the rules, it is NOT
considered SPAM, so it's perfectly legal!NEED PROOF? Here are just two testimonials from
individuals who decided to invest nothing more than a
little of their time.
Tony Stevens, Vandenberg AFB, CA:
Hey! I got your e-mail! YOU ROCK! I sent it to all of
our frat brothers.....and while I haven't seen my $20
grand yet, I'm up to $8,285. Hook me up when you run
this program again........
Mary Gathers, Columbia, SC:
Hey cuz! This is Mary. I only have one thing to say to
you... OH MY GOD! I sent 20 e-mail's out like you said
and went on vacation. When I got back, my account was
up to over $12,000! I owe you!
If you're not already a user, the very first thing you
need to do is go to PayPal and SIGN UP. It takes two minutes
and PayPal will deposit $5.00 in your account once you start
using it. That makes this program FREE!
Then...... SEND a $5.00 payment from your PayPal account
($5.00 you can earn back from Paypal, which makes this program FREE!)
to the FIRST email address in this letter (No.1) along with a note
saying "Please add me to your mailing list."
Don't laugh! Try this while you wait for the others to start working.
One half hour of work to get started - no mailing lists. No printing,
copying or waiting and the concept is 100% legal (refer to US
Lottery Laws, Title 18, Section 1302 and 1341, or Title 18,
Section 3005 in the US code, also in the code of Federal
Regulations, Volume 16, Sections 255 and 436, which state a
roduct or service must be exchanged for money received).
This version has nothing to do with Postal Laws, as it' EMAIL
Here's How It Works. Unlike many other PayPal programs, this
THREE LEVEL PROGRAM costs only $5, that's right, only $5 ONCE,
which is much more realistic and brings much, much faster results.
No cheating can occur (Don't be fooled by other PayPal
letters that mention cheaters) as Paypal only allows one Account per
Because it is so easy, the response rate is VERY
HIGH, VERY FAST-Internet E-mail FAST-and you will
start seeing results in less than one week! JUST IN TIME FOR NEXT
MONTHS BILLS! You need only mail out 20 copies, to start with.
Start right away, as soon as you pay the #1 email address below!
Send to personal contacts, reply to people who send their programs
to you as they are already working on the web, and they know these
programs work. They are already believers in the system!
Once you have paid the $5 to the number one (No. 1) email position,
please send an email to the No.3 postion, with "THANKS I'VE JOINED" in
the subject (topic) area, and I'll send you a copy of the "Follow Up
Letter" that is FULL of TIPS and HINTS on where to obtain
THOUSANDS of spam free email addresses to send to, where
to find free web based email accounts to send your emails from,
instructions on how NOT to lose a web based email account, and much,
much MORE.This program is MUCH, MUCH FASTER and has a
HIGHER RESPONSE RATE than any other program!
Even if you are already in another program, stay with it, but do
yourself a favor and DO THIS ONE as well. START RIGHT NOW!
It's simple and will only cost $5.00 max. It will pay off long
before others even begin to receive letters! Just give ONE
person a $5.00 gift (REMEMBER THOUGH, this $5.00 is the $5.00
That's all! If you already have a PayPal account, please still donate a
$5.00 GIFT to the person in the No.1 spot and add your name on the list
at No.3 position having moved up the remaining two. Follow
the simple instructions and in two weeks you will have approximately
$20,000 in your PayPal account!
RESPONSE RATE! All from just one $5.00 transaction that
you can get back from PayPal!!!
Follow These Simple Instructions: Click below to open your
free Paypal account, and be sure to open a Premiere Account, as it
does not limit you to how much money you can have deposited to your
account. Then come https:
back to these instructions.

Once you link to the Paypal site using the link above,
open your PayPal account, and E-mail the $5.00 payment to
the FIRST name on the list (#.1) along with a "note" in the NOTE AREA
of that page, saying "SUBSCRIBE ME TO YOUR MAILING LIST".
Be certain to add this note, as this is what KEEPS THIS LETTER LEGAL.
Instructions on how to send a payment are under "SEND MONEY" at
the Paypal site. It's soooo easy!!
Only the first person on the list gets your $5.00 gift.
after you have made the $5 payment.
Then, move the other two email addresses UP and
Don't try to add your name in the first place in order to earn money
If you do that, you will ONLY reach people you send e-
mail to then your name will be immediately removed
from the No.1 place and you won't reach thousands of people!
But if you add your name on the No.3 place, there will be millions of
people receiving and sending e-mail's later, when your name is No.1!!!
Send out 20 copies (minimum) of this letter, but
only to people you know, or respond to MLM offers. Once
you've paid the person in the #1 position, be sure to email
the person in the #3 position, with "Thanks, I've Joined" as
a topic in the reply. You will then receive a follow up letter that
is full of SPAM free hints and tips to insure your success in
this version of the PayPal letter.
ALSO NOTE: By sending this letter and the payment via E-MAIL,
the response time is much faster... ELECTRONIC TRANSFER
Consider this! Millions of people surf the Internet
everyday, all day, all over the world! Here are the 3 people
to start with. Sign up, send $5.00 to the first person, move
the other two up to Nos 1 & 2 respectively and add your own
e-mail address at No.3. Be sure to use your email address
that is associated with your PayPal account.


Monday, May 5, 2003

*  Recent Topics

*  Fog Creek Home