Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Feature Req.: "if field is defined" condition

I've had some time to play with CityDesk, and it looks like an interesting product...

One potentially useful feature would be a new CityScript command... an "if field is defined" type command. The default template, for example, looks somewhat akward if the sidebar field is left blank and you just get an empty box on the page, or if the author field is left blank you just get a line by itself that says "By" with no name by it.

So, it would be able to say "if this field has a value, then do this...." It wouldn't need to be too advanced in terms of supporting "else" or "else if" type stuff... just an "if" and "if not" command.

I realize that the same end result could be accomplished by using different templates that include different combinations of information, but these combinations could quickly multiply... with byline and sidebar, without both, with one but not the other, and then multiply those by the possible uses of the "extra" fields.... it would be a lot easier to have one template with some basic conditionals based on whether or not certain elements are included.

Matthew R. Wilson
Thursday, October 18, 2001

Good idea!

Joel Spolsky
Thursday, October 18, 2001

Is there a workaround for not displaying empty sidebars? It would be great to have more "conditional" control over the templates...

Ben Meiry
Monday, January 21, 2002

*  Recent Topics

*  Fog Creek Home