Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

{$ between $} in loops

On my latest site I tried to create a nice sidebar using a loop with {$before$} {$between$} en {$after$}

Sidebar should be looking something like this:
| top text        |
| information    |
|                      |
| top text 2      |
| information 2 |
|                      |

The top text parts should be created automatically using the BEFORE and BETWEEN statements.

Problem is that within the BEFORE you cannot use {$x.headline $} (Citydesk generates an error). Well - i can understand that and work around it.

But on top of that, you can use {$ x.headline $} in the BETWEEN statement, but it will list the headline of the *previous* item!
So in this case one can only use the BETWEEN statement in conjunction with {$x.headline$} to place an headline *after* the text.

Not very useful....

Ewout de Graaf
Thursday, September 23, 2004

Usually you use before to set up the begining of a table (<table><tr><td>), and after to close it off (</td></tr></table>). The between is then used to close a row and start another (</td></tr><tr><td>).

On each loop you would then maybe use:
{$ x.headline $}
{$ x.extra1 $}

Obviously if you're wise you'd use divs instead of tables, but I think the above is easier to follow as an example.

I hope I make sense, and I also hope this forum doesn't get mangled by the tags I've used!

Ian Jones
Thursday, September 23, 2004

Phew, didn't get mangled!

I forgot to say, I'm assuming "information" is just from the one article you're getting the headline from, in the above I've used the extra1 field for "information".

If however you're wanting to use different articles for "top text" and "information", then you should probably have a look at "odd" and "even".

Ian Jones
Thursday, September 23, 2004

*  Recent Topics

*  Fog Creek Home