Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

includinf articles from only from 1 dir lower

I am trying to write a script that includes all articles named "index" from only one directory level lower than the current one.

If I have:

    --->CLASSES (DIR)
    --->BOOKS (DIR)

I would like to have a script in the top level index that includes only NOTES/index and ESSAYS/index.

We start with:
and (folder "articles/*") (fileName "index") )

which gives me every article "index" in the site. Can I specify the include is for only the next level down in the "folder" part?


Steve Barlow
Friday, February 6, 2004

No but you can use keywords, something like

{$ foreach x in (and (folder "articles/*") (keywordContains "(index)") ) $}

Then put (index) in the keywords property of the articles you want to index.

Ken McKinney
Saturday, February 7, 2004

How about

(and (or (folder "notes") (folder "essays")) (fileName "index"))


I think that's what you want.

Saturday, February 7, 2004

or put a keyword "topindex" in the top level index, then use not(keyword_contains "topindex"). This will return all index files except the top one with the keyword.

David Watts
Sunday, February 8, 2004

It seems there are a number of ways to skin the cat!

I use a keyword convention of naming index pages as follows "p_ndx1", "p_ndx2", etc which allows me to indicate a) that the page is an index and b) the level in the hierarchy.

I can then set the query to retrieve the desired level of index page(s) in my scripts. Alternatively, I can leave the number off the parameter and just get all index pages.

Wednesday, February 11, 2004

*  Recent Topics

*  Fog Creek Home