Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Caption - a feature greatly missed

Having used captions with pictures extensively I really miss the option to write these directly in CD2.
As a programmer I will of course be able to insert the necessary html code myself, but clients will now be left in the dark as this is not *that* simple to do.

Maybe a solution would require two ways of inserting pictures: one simple (like the new one) and one advanced (like the old one without the bugs).

Jorgen Brenting
Wednesday, May 07, 2003

The problem with 'caption' is that it does not (in the w3c spec) take a position specification and is designed to appear *above* a *table*.

So the CD code that inserted them was not 'validatable', apart from all the little bugs that appeared.

I agree it would be nice to have a working caption, but I'd suggest that we'll just have to wait for standards-based options that achieve the desired result (hah!), or use XHTML/XML, or continue to roll-our-own...

MeJ

James Roberts
Wednesday, May 07, 2003

We had to remove that feature because our cheasy method of inserting TABLES was responsible for a huge percentage of the crashing bugs in CD 1.0. It was just not really possible to get it right. So we've regressed for a while.

If anyone can think of a nice clean HTML/CSS way to add a caption to an arbitrary element (or even to an IMG tag) that doesn't require lots of tag soup, we're open to suggestions!

Joel Spolsky
Thursday, May 08, 2003

In the meantime if you stick to left aligned images, you can just ad text immediately below the image and separate it from the rest of the text with a couple of line breaks. Perhaps make the font 1 step smaller or whatever suits you best.

It's not that big a question really, but the feature was nice to have as long as it lasted. I realize that the new way of inserting pictures is much cleaner and much safer than the old one

Jorgen Brenting
Thursday, May 08, 2003

Maybe I should add that you have two possible positions for a (false) caption if you use the <br clear=all> tag instead of the usual <br> or <p> tags.
1) Caption under the picture: Insert the picture left aligned. Place the <br clear=all> tag immeadetly after the image tag. Write the caption and insert some line breaks. Write rest of text.
2) Caption to the right of the picture: Insert the picture left aligned, write the caption, place the <br clear=all> tag. The rest of the text will continue under the picture.

Jorgen Brenting
Thursday, May 08, 2003

http://www.alistapart.com/stories/practicalcss/
shows some examples of captions in HTML+CSS.

I have not used captions because of their buggy behavior. I prefer to write my own HTML. I would like it if :
- caption is stored with the image file (e.g. {$PTMFOG0000000011.gif.caption$})
- html code for img's can be edited in template form

e.g. define a IMG tag just like a date/time format
{$setImgCode:
<div class="float">
  <img src="{$img$}" width="{$img.width$}" height="{$img.height$}"
  alt="{$img.headline$}" /><br />
  <p>{$img.caption$}</p>
</div>
$}

The trick: if html is inserted, then it can be messed up by the user. I would suggest that CD only knows it if it is in the exact same form as the SetImgCode. So in Perl or PHP I would create a regular expression with patterns for the placeholders to find out about the image properties before showing them in a dialog and warn if the code has been altered outside citydesk.

Adriaan van den Brand
Thursday, May 08, 2003

Joel,

Captions are a basic feature that needs to be supported.  Here is how EZPublish does it:

DIV.imageleft {
  CLEAR: both; DISPLAY: inline; PADDING-BOTTOM: 4px; PADDING-TOP: 4px
}
DIV.imageright {
  CLEAR: both; DISPLAY: inline; PADDING-BOTTOM: 4px; PADDING-TOP: 4px
}
DIV.imagecenter {
  DISPLAY: block; PADDING-BOTTOM: 4px; WIDTH: 100%; PADDING-TOP: 4px
}

<DIV class=imageleft>
  <IMG src="tiny-arrow.jpg">
    <DIV style="WIDTH: 78px">
      <P>This is the caption for the image </P>
    </DIV>
</DIV>

Where width is the width of the image.

David Burch
Thursday, May 08, 2003

David, the problem is that you have to put in the width of the image by hand.

Jorgen Brenting
Friday, May 09, 2003

not in my template suggestion

By the way: davids code is similar to that in the link I gave.

Adriaan van den Brand
Friday, May 09, 2003

Jorgen,

I am suggesting that CityDesk maintain the correct width of the image in the width attribute--and showing that it can be done and is being done by a competing product. 

I don't mind doing the CSS stuff myself.

David Burch
Friday, May 09, 2003

This could also be done using p tags and classes, which might make it more backward compatible?

David Burch
Sunday, May 11, 2003

BTW:  You cannot "...stick to left aligned images..." because the surrounding paragraph of text will not wrap around the image.

David Burch
Wednesday, July 16, 2003

*  Recent Topics

*  Fog Creek Home