Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

2.0RC : compex scripting problems

I am trying to dynamically generate a DHTML menu (for the Milonic DHTML menu: http://www.milonic.co.uk/menu/)

I want to generate menu's in a menu_array.js file.  Here I have this loop:

{$foreach x in (fileName "mymenu") $}
{$x.body$}
{$next$}

Then, I have an item "mymenu" in a directory which contents I want to store in the menu. This item looks like:

addmenu(menu=["{$.absLink$}",
,,150,1,"",style1,,"left",effect,,,,,,,,,,,,
{$foreach q in (and (ThisFolder) (not (ThisArticle))) sortAscendBy .Headline$}
,"{$q.headline$}","{$q.abslink$}","","{$q.headline$}",0{$next$}
])

When I look at the generated HTML file, it is ok. However, the javascript aborts with an error: the {$x.body$} is NOT THE SAME as the body in the file "mymenu.html"

I think I will revert back to PHP until CD 3.0....

First I tried to store it in a variable

Adriaan van den Brand
Monday, August 11, 2003

I have solved my problem by using a different approach:

I have put plenty foreach loops in my menu script file rather than filling the menu recursively. The probem is mapping Menu id's (e.g. "products") to lists of articles (e.g. all items in the "\products" folder). It is now hardcoded in the foreach loops (one foreach loop for each menu, submenu etc.)

If anyone would like to see a script to fill DHTML menu's for milonic.uk please let me know. It is fairly straight forward now.

Adriaan van den Brand
Tuesday, August 12, 2003

wow.. you have a pagerank of 9 of 10 in google :)~

Robert Cappa
Wednesday, August 13, 2003

What do you mean Robert?

Adriaan van den Brand
Thursday, August 14, 2003

its the popularity index of google. each web has one from 0 to 10.

you can see it if you install the google-bar

http://toolbar.google.com/

Robert Cappa
Thursday, August 14, 2003

Well, I didn't make the Milonic DHTML menu... I'm just using it (not yet life) my pages score only about 3-4...

Adriaan van den Brand
Friday, August 15, 2003

*  Recent Topics

*  Fog Creek Home