Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

BUG: Template editor trips over single quotes

I made a template for pages that shouldn't get published. In HTML view I typed this:
<html>
<body>
<!-- dummy template for files that shouldn't get published -->
</body>
</html>

Clicked Normal view then HTML view again, and to my surprise the source had changed to this:
<html>
<body>
</BODY></HTML>
My comment gone, and for some strange reason the closing tags had been changed to upper case...

Playing with it some more showed that the single quote in the comment is the problem. Leaving out the single quote or adding a second directly after solved the problem.

Duq
Saturday, September 06, 2003

I've an article that I include in every script as a header. It starts with

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>{$.siteName$}{$ if nonBlank .headline $} - {$ .headline $}{$ endIf $}</title>
    <link rel="stylesheet" type="text/css" href="PTMFOG0000000015.css" title="default" media="screen" />
    <link rel="stylesheet" type="text/css" href="PTMFOG0000000177.css" title="default" media="print" />
    
</head>

<body style="COLOR: black; BACKGROUND-COLOR: white" topmargin=3 leftmargin=3 bottommargin=3 rightmargin=3>

{$ setDateTimeFormat "*" "dd/MM/yy" "HH:mm" $}


If I edit this article and switch to HTML mode and back, all code has disappeared apart from the last line.  NB My site does NOT look pretty without style sheets, to put it mildly.

Vic
Saturday, September 06, 2003

Are you saying that you enter the above code while in normal view? If so then you need to enter it in html view to begin with, then never switch that article to normal view.

Ron Lane
Saturday, September 06, 2003

Ron, if that question is directed at me, I enter the code in HTML view.

And it would be real nice if it didn't disappear just because someone switches to Normal view.

Vic
Saturday, September 06, 2003

Vic, if you remove the second string in the DOCTYPE tag you're fine. So just put
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
at the top of your document.

What is the second bit for anyway?

Duq
Saturday, September 06, 2003

Dug, thanks, I had taken over the first part of the header from a template. 

And no, if I take the additional strings out CD still gets rid of the CSS references upon switching to Normal View...

Vic
Sunday, September 07, 2003

I know you would like to be able to switch between norman and html views, but, from reading these forums it looks like that if you enter anything from the html view you need to not switch to normal view. That may get fixed in the future but, as we speak don't switch from html to normal, thats not always true vice versa.

Ron Lane
Sunday, September 07, 2003

I had to solve this by using a variable, then I do an include of that variable in all of my templates.  Then the stuff in the header are not stripped out.
This may not be applicable for your situation.

Jeff Tulley
Monday, September 08, 2003

Going back to the original problem: CityDesk Template editor trips over HTML Comments containing single quotes.
Anyone at Fog Creek listening?

Duq
Friday, September 12, 2003

*  Recent Topics

*  Fog Creek Home