Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

index file mangled when I insert image?!?!

I just spent some time designing a nice, simple new web site.  It was working great, looked good, and was exactly as I liked it.

I decided to insert an image into the index page of the site, using the "import image" function.  Upon doing so, I noticed that the background color of the site had changed.

I opened up the index file, and the headers had been stripped out of the index page.  This was a problem, since I had some conditional logic that determined what the <title> of the page would be (the headline of the latest article got put in the <title></title> tags.

Is this a known problem?  I see mention of many bugs, but I do not see this mentioned in a quick scan of previous questions.

This makes me not want to use the image insert at all.

Saturday, April 26, 2003

I've inserted boatloads of images and never had a problem like yours.

It sounds like you've designed a complete html page in a CityDesk article.  CityDesk will remove "non-body" stuff from articles.  For example, if you were to paste a complete HTML page into an article, City will remove the <head> tags and everything between them.  It will remove the <html> and <body> tags too. City expects that stuff to be in a template.

You can design an index.html page (not an article) and City will leave it alone.  But, overall, it's better in most cases to use templates and articles for your pages.

Saturday, April 26, 2003

Oh, I see -- thank you for your advice.  I will put that stuff in a template.

I was inserting the image directly into the index.html file.  CityDesk did take out everything "non-body" from the file ... and the fact that it was the index.html file did not prevent it from doing so.

Thanks again.

Sunday, April 27, 2003

I've found that I can paste html into the hml view of an article and access it.  But in order for it to remain unmangled you must never look at it in normal view.

I use
{$foreach x in (filename"ArticleTemplateTopMenu")$}
{$ x.body $}
to access the html.  It beats trying to hold it all in a variable.

Lawrence Calmus
Sunday, April 27, 2003

*  Recent Topics

*  Fog Creek Home