Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Can CityDesk do Related topics?

I'm working on a music site that will include CD reviews. Each review will be an article, and will include an .extra field for the performer.

In each review, I'd like to include a table with links to any reviews of other CD's by that artist. For example, if we reviewed Bob Dylan, the table would show other Dylan albums.

I'd like to do this automatically, so I'm looking for a way to build a template that would show articles related to the current article. In other words, the template would look at the .extra field for the current article, and create a table with any articles that had the same .extra field.

Any suggestions on how to do this?

Jim L
Friday, December 12, 2003

check into keywords

joel goldstick
Friday, December 12, 2003

You can create cityscript which lists all the articles that include a key value in the keywords section. You can tell it to look for dylan(albums) dylan(songs) dylan(articles) dylan(reviews) etc.

I am working at a client today, I can't write out the cityscript. But there are plenty of examples in this forum and in the CD help files.

I wish there was a way to archive all the cityscript examples and post them somewhere along with a short doc....hmmm!

John Cesta

john cesta
Friday, December 12, 2003

.. But there's no way to do it automatically, you have to do it manually in each article.
Friday, December 12, 2003

Joel and John

It sounds like you think this may be possible.  I know how to create a list of documents that have a related keyword or .extra1 entry. However, my question was about automatically looking for the articles that had the same keyword as the current article.

I think this would involve putting the variable for the current article into the loop that includes the related articles. When I try this, it doesn't work though.

Has anybody gotten this to work. If so, can you give me an example?


Jim L
Sunday, December 14, 2003

Unfortunately you can't automate this completely.  You can't use variables in a for loop like that.  You can put the entire loop in a variable and place that in your article.

Ken McKinney
Sunday, December 14, 2003

Ken has it right about variables for loop conditions.  This non-capability shows itself in lots of situations where CD script can almost, but not quite do something.

If you can do server side scripting (ASP or PHP, etc.) you can work around this sort of thing.  You could also do some nifty javascript, but then, only users with javascript turned on could use those features. 

Maybe v3 of CD will address this?

joel goldstick
Sunday, December 14, 2003

*  Recent Topics

*  Fog Creek Home