Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

nextLink and thisArticle

I can't get this to work and I need to know whether I'm just plain stupid or there's a bug. I'm using 2.0.19 and searched all over and found references to this not working back in beta 2.0.5 or something but also that it's been fixed.

Code (residing in template):

{$previousLink p in (and (thisFolder) (not (thisArticle)) )$}
{$p.headline$}
{$end$}

Symptoms: no HTML is generated at all for the links. I changed the previousLink : end to a foreach : next, and lots of links appeared so there are definitely articles there.

Any ideas?

Ta

Sam Strachan
Saturday, July 03, 2004

This is working for me:

{$previousLink p in (folder "paper") $} 
<a href="{$p.link$}">{$p.headline$}</a>
{$end$} 
{$nextLink n in (folder "paper") $}   
<a href="{$n.link$}">{$n.headline$}</a>

David Burch
Sunday, July 04, 2004

My recollection is a little hazy because it's from something I tried a while ago that didn't work. But I think that thisFolder doesn't evaluate to the folder of the current article if it's invoked from a template.  You can use it within an article body to pull in other articles in the folder but not from a template.

Try  dropping the code into the body of one of the articles and see if it works.

Ken McKinney
Sunday, July 04, 2004

Possibly it's the (not (thisArticle)) that's causing the problem. That doesn't really make sense, since you're trying to link to the article before the current one in a list, but the current one isn't in the list. Try just putting (thisFolder) in the search criteria.

Darren Collins
Monday, July 05, 2004

*  Recent Topics

*  Fog Creek Home