Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Problem With Single-Paragraph Articles

I've been using CityDesk to maintain my weblog at www.pool-room.com. Because I use a separate article for each blog entry, I often wind up with single-paragraph articles.

The problem is that if you only have one paragraph of text in an article, CityDesk doesn't put <p></p> tags around it. You can check this by typing 'blah' into the Article window, then looking at the HTML View. Go back to Normal View and hit enter - now the HTML View has put paragraph tags around the text (but you've got an extra blank line).

This means single-paragraph entries render differently from multi-paragraph entries, and you end up with inconsistent spacing and other problems. Is it possible to fix this in SP1, Joel?

My only workaround so far has been to avoid single-paragraph articles completely.

This issue also affects other fields, such as Extra1, Extra2, Sidebar, etc.

Darren Collins
Tuesday, January 29, 2002

Darren you are correct. I never noticed.  I have bunches of one sentence articles.  If the <p>'s were suddenly to appear, there's no telling what my sight might look like.  I guess I'd get a lot more double spacing.

Sounds like a feature, maybee.

tk
Tuesday, January 29, 2002

I can see your point, too, Terry. But what do you do when one of your articles or fields grows to two paragraphs? Doesn't that mess up your formatting?

Here's another example from my site that's messed up:
http://www.pool-room.com/Personal/Photography/fog0000000087.html

I haven't yet found a decent way to work around this when you want to combine single-paragraph and multi-paragraph fields/articles on one page.

How do other people handle this inconsistency?

Darren Collins
Tuesday, January 29, 2002

I really meant feature as a difficult design choice the Fog folks had to make or live with.

tk
Tuesday, January 29, 2002

Hmm, I think it's probably more likely an oversight than a deliberate design choice. It's not documented anywhere, and it has the potential to bite users if they're not aware of it.

I can't see any benefit in *not* putting tags around single-line fields (but that doesn't mean there isn't one!). Now that the application's out there, though, I can see how changing it would muck up sites like yours that expect this behaviour. Even so, I'd still like to see it changed for consistency's sake.

What happens to your site if you make one of your single-paragraph articles into a two-paragraph one? Does it break your formatting?

Darren Collins
Tuesday, January 29, 2002

My one-line articles end up as the links on my "tips" page:
http://tk-jk.net/city/Articles/fog0000000010.html

As Kevin mentioned above I added a carriage after the sentence which added <P> </P> around the original sentence as well as a <P>&nbsp;</P> for my carriage return.  That messed up my spacing.

Then, I erased the <P>&nbsp;</P> but left the "P's" around my original sentence.  That messed up my spacing too.

This is the only site that I have like this.  If the single sentence article had "p's" I could easily adjust the scripts to handle it.  I'm with you, I'd like to see it consistent and predictable.

tk
Tuesday, January 29, 2002

Yeah, I never had problems when I built lists using CityScript loops where every article had one line, or where every article had multiple lines. The problem arose when I tried to mix single-line and multi-line articles in the one list.

Darren Collins
Wednesday, January 30, 2002

I encountered this problem too. Since I was using Citydesk to create a WAP-version as well as HTML version this was a major problem, the text must be in a paragraph. I came up with two solutions: either make a extra empty paragraph manually in every article or run all WML-pages thru some PHP scripts run locally before publishing.

David Pettersson
Wednesday, January 30, 2002

Hi!

This feature is By Design. The reason it's like this is because you may want to put a bunch of things all on one line. For example:

{$foreach x in (all)$}{$x.body$}{$next$}

The design of your site may be such that the body is one or two words, and you want them strung together directly without each body being in its own paragraph.

If you do have a template that was designed to assume multiple paragraph bodies, and occasionally you have a story that is just one paragraph long, put two <br> breaks (Shift+Enter Shift+Enter) at the end of the story, and it will fit in with the formatting of all the other multiple-paragraph body stories. That is what I do on Joel on Software to keep even spacing between the end of a daily news item and the next date slug.

Joel Spolsky
Friday, February 01, 2002

Two <br> breaks in the template or in the one-paragraph article?

tk
Friday, February 01, 2002

In the one paragraph article (at the end).

Think of it this way. If your template assumes that body's will come in with their own paragraph marks, it is designed to assume a blank line after then end of the body. When you have a one paragraph body, it comes in without its own paragraph marks and thus does not come in with a blank line at the end, and your template will be missing a blank line at the end. You can put it back by adding two <br>'s to the end of the body and it will look the same as the other bodies that came in with Ps.

Joel Spolsky
Friday, February 01, 2002

OK, that sorts out spacing issues. Now that I understand the reasoning behind 'no <p> tags', I agree with it. Perhaps you could suggest a work-around for this formatting problem, though:

I encountered an issue where the single-paragraph articles don't get the right formatting from a style sheet because they don't have enclosing <P> tags.

Have a look at this page to see what I mean:
http://www.pool-room.com/Personal/Photography/fog0000000087.html

In particular, look at the photos of the iris and the angel. Because the comments next to the photos don't have <P> tags, they don't pick up the formatting of the <P> tag from the CSS file. So they print with a different font.

In this case, I had to work around it by just adding an extra blank line to the Extra2 field for single-line entries. I've removed the extra lines temporarily to show you what happens - I'll be putting it back in a few days to fix up my page formatting.

Any suggestions, anyone?

Darren Collins
Sunday, February 03, 2002

If I did it as specified above (two <BR>'s) I ended up with double spacing.  But I probably should have fixed the script too.  I don't have the time to experiment right now.

tk
Sunday, February 03, 2002

*  Recent Topics

*  Fog Creek Home