Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Invalid CityScript.  Help.

I'm stumped.

v2.0.19, aka 2.0 Gold.

Oh for Christ's sake.  <scream, scream, scream, scream>

I'm trying to do an {$ even $} {$ odd $} combination but it's completely screwing up.  I do all my coding within HTML View, but CityDesk is complaining about invalid CityScript syntax when I go to publish.

This is going to be a long and incredibly lame post, so if you're not FogCreek you may want to skip it.

Full copy of article from HTML View:
<p>See: <a href="PTMFOG0000000979">Linking to Files, Etc., Hosted Here</a>. No, it doesn't say "Don't do it." Quite the contrary. It explains why you may get 404 errors when you manually link to files here.</p>
<p><strong><font size="5">Resources</font><br /><font size="4">Software</font></strong></p>
<table cellspacing="0" cellpadding="0" border="0">
<thead>
<tr><td><b>Added or Modified</b></td><td><b>Download Link</b></td><td><b>Developer's Site</b></td></tr>
</thead>
<tbody>

{$ forEach x in (folder "/CSharpResources") SortDescendBy .filedDate $}

{$ odd $}
<tr class="OddRow"><td>{$ x.filedDate }</td><td><a href="http://www.schkerke.com/pphlogger/dlcount.php?id=schkerke&url=http://www.schkerke.com/Files/{ $x.extra1 }">{$ x.extra2 }</a></td><td>{ $ x.author }</td></tr>
<tr class="OddRow"><td colspan="100">{$ x.teaser }</td></tr>
<tr class="OddRow"><td colspan="100"></td></tr>
{$ even $}
<tr class="EvenRow"><td>{$ x.filedDate }</td><td><a href="http://www.schkerke.com/pphlogger/dlcount.php?id=schkerke&url=http://www.schkerke.com/Files/{ $x.extra1 }">{$ x.extra2 }</a></td><td>{ $ x.author }</td></tr>
<tr class="EvenRow"><td colspan="100">{$ x.teaser }</td></tr>
<tr class="EvenRow"><td colspan="100"></td></tr>
{$ next $}
</tbody>
</table>

When I attempt to publish I get
Invalid CityDesk Syntax (\Articles\Generic Resources for C#:2178)
An error occurred while publishing, so the site was not uploaded.

Maybe I'm just incredibly stupid, but I can't see where the syntax error is in the above.  To make matters worse I normally switch to HTML View to verify my CityScript appears to be interpreted correctly since it shows -only- CityScript and literals.

Examining the article in the database doesn't show any hidden links or problems in the Extra1, Extra2, Author, Sidebar fields.  (A common problem for me is that in the HTML code is buried and has some snippet of a problem, and since the aforementioned area doesn't let you look at those sections in HTML View you're kinda screwed unless you open the database directly.)

If I open the Article in Normal View I get..

See: Linking to Files, Etc., Hosted Here. No, it doesn't say "Don't do it." Quite the contrary. It explains why you may get 404 errors when you manually link to files here.

Resources
Software

Added or Modified Download Link Developer's Site
{$ odd $}
{$ forEach x in (folder "/CSharpResources") SortDescendBy .filedDate $}

{$ x.filedDate } {$ x.extra2 } { $ x.author }
{$ x.teaser }

{$ even $}  {$ x.filedDate } {$ x.extra2 } { $ x.author }
{$ x.teaser }

{$ next $} 

Obviously the internal structure of that loop is completely toasted.  But that is NOT what I entered.  So I go to fix it..

And my article now looks like...
<p>See: <a href="PTMFOG0000000979">Linking to Files, Etc., Hosted Here</a>. No, it doesn't say "Don't do it." Quite the contrary. It explains why you may get 404 errors when you manually link to files here.</p>
<p><strong><font size="5">Resources</font><br /><font size="4">Software</font></strong></p>
{$ even $}{$ next $}
<table cellspacing="0" cellpadding="0" border="0">
<thead>
<tr><td><b>Added or Modified</b></td><td><b>Download Link</b></td><td><b>Developer's Site</b></td></tr>
</thead>
<tbody>


{$ forEach x in (folder "/CSharpResources") SortDescendBy .filedDate $}

{$ odd $}
<tr class="OddRow"><td>{$ x.filedDate }</td>
<td><a href="http://www.schkerke.com/pphlogger/dlcount.php?id=schkerke&amp;url=http://www.schkerke.com/Files/{ $x.extra1 }">{$ x.extra2 }</a></td>
<td>{ $ x.author }</td>
</tr>
<tr class="OddRow">
<td colspan="100">{$ x.teaser }</td>
</tr>
<tr class="OddRow">
<td colspan="100"></td>
</tr>
<tr class="EvenRow"><td>{$ x.filedDate }</td>
<td><a href="http://www.schkerke.com/pphlogger/dlcount.php?id=schkerke&lt;SPAN id=fogstart&gt;&lt;/SPAN&gt;&lt;SPAN id=fogend&gt;&lt;/SPAN&gt;&amp;url=http://www.schkerke.com/Files/{ $x.extra1 }">{$ x.extra2 }</a></td>
<td>{ $ x.author }</td>
</tr>
<tr class="EvenRow">
<td colspan="100">{$ x.teaser }</td>
</tr>
<tr class="EvenRow">
<td colspan="100"></td>
</tr>
</tbody>
</table>

I was going to edit the above to include only the problem areas but the whole article is a problem.  My links have had spans inserted into them, my ampersands have been replaced with &amp, my CityScript is .. unrecognizable.  I don't know what rule I'm breaking but apparently I am.

I give up.  My host uses PHP, I guess it's time for me to bite the bullet and get a better grip on it and do the programming server side with FrontPage as the CMS.  I just lost a weekend to revamping my site to support the above syntax thinking it'd make long term maintenance easier on myself and now, instead, I can't even update my site because my most popular page is destroyed.  (My fault, should've kept a backup.  As of now I've entered and left CityDesk trying to get a grip on this so much I don't have a valid backup.)

Brian Schkerke
Sunday, September 14, 2003

A lot of your variables are missing the dollar sign before the closing brace.  For example: {$ x.teaser } should be
($ x.teaser $}

David Burch
Sunday, September 14, 2003

Well geez paint me purple and call me stupid.

Thank you, very much.

Brian Schkerke
Sunday, September 14, 2003

*  Recent Topics

*  Fog Creek Home