Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Using a Cd Variable in Keyword search

I'm trying to use a KeywordContains search using the keyword from the current article as the search key, but it isn't working. Is there a way to do it using a variable or field in the current article?

I've tried using variations of the following without success:

{$foreach x in (KeywordContains "{$x.Keywords$}") sortascendby .FileName $}

I only have one keyword in my articles, and I can see that  "{$x.keywords$} is getting the right value, but it displays nothing in the foreach loop.

Any suggestions?

Dennis Harwood
Thursday, January 29, 2004

Unfortunately you can't.  Cityscript doesn't expand variables in for statements.

This something that's requested oh..maybe daily... :-)  Many of us are hoping for significant improvements in city script in the next version.

Ken McKinney
Thursday, January 29, 2004

Thanks.  That's kinda what I figured after trying every variation I could think of.  I keep running into limits with variables.  I spent years programming in COBOL, FORTRAN, RPG, dBASE, etc., and I keep trying to find ways to get CD to do what I want it to do.  Somethings are working, others will simply have to wait for the next release and hope for the best.

Any news on when version 3 will be released?  I've got three websites running CD now and I'm just about to finish a major site that I'm going to be converting everything to in the very near future.  I would hate to do a bunch of stuff only to have to re-do it when v3 comes out.

Dennis Harwood
Thursday, January 29, 2004

*  Recent Topics

*  Fog Creek Home