Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Newbe scripting problems


I am struggling here. I downloaded jobposting.cty and am now trying do duplicate it in my file.
I have a folder called Maps and an Article called maps. in maps I have the syntax    "    Overview

{$ foreach 12 in (folder "\Maps\Overview") SortAscendBy .extra2 $}{$  .headline $}  ({$  .extra2 $})  "

The foler below Maps in Overview with two articles in it. When I publis it and click on Maps nothing happens. Not even the word Overiew shows.

???

Joe Knapp
Thursday, August 26, 2004

{$ next $} ?

_
Thursday, August 26, 2004

Try This:

{$ foreach 12x in (folder "/Maps/Overview" SortAscendBy .extra2 $}{$  .headline $}  ({$  .extra2 $})
{$ next $}

_
Thursday, August 26, 2004


I had that and took it out.
When I publish I get this:

Next without ForEach (\Maps\maps:1875)
An error occurred while publishing, so the site was not uploaded.

Joe Knapp
Thursday, August 26, 2004

If what you've posted is accurate, you need "foreach 12x" where you just have "foreach 12". And you need a {$ next $} at the end of the loop.

If that's not the problem, could you please copy and paste the actual CityScript you're trying to use, and tell us the exact error messages you're seeing (if any)? It's a bit hard to decipher your description.

Darren Collins
Thursday, August 26, 2004

Oh, and I think you need x.headline and x.extra2 in the loop body, not just .headline and .extra2.

Darren Collins
Thursday, August 26, 2004

Okay I got it to publish

<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

{$ foreach x in (folder "Maps\Overview") SortDescendBy .extra2 $}<a href="{$x.link$}">{$ x.headline $}</a>&nbsp;({$ x.extra2 $})<br />
{$ next $}

but it does not seem to work. 
I am using a downloaded template called Gila Two.
I don't see how to get the left side menu to display my pages. I will just keep trying.

Joe Knapp
Thursday, August 26, 2004

{$ foreach 12 x in (folder "\Maps\Overview") SortAscendBy .extra2 $}{$  x.headline $}  ({$  x.extra2 $}) 
{$ next $}

Ronald Vogelaar
http://www.life4all.net

rognvaldr
Friday, August 27, 2004

What do you mean by "it does not seem to work"? What were you expecting to happen, and what actually happened?

Darren Collins
Sunday, August 29, 2004

I gave up on it and just used the template. It works fine.

Joe Knapp
Wednesday, September 08, 2004

*  Recent Topics

*  Fog Creek Home