Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Setting color for active page in a forEach loop

Hello, I wonder if somebody have an idea how to set the text color for the active page in a forEach loop listing, typically the Headline texts. What I want is to have the selected page highlighted in a different color for the user to navigate more easily. I'm migrating a site to CityDesk so I am not yet familiar with all fancy things you can do.
Help much appreciated

Peter Axelsson
Monday, April 5, 2004

That may give you some ideas. This site does it (mostly) for the top menu

Monday, April 5, 2004

You want to mark the page the user is looking at in a menu?

Paul Vanovertveld
Monday, April 5, 2004

I have all Pages, that I want to be displayed in the menu in blog/general
each of these pages uses a Template where the body tag is build

     <body id="{$.filename$}">
and the filenames are PhotoAlben, Archive, About, ...

The Menu is build with this script

    {$foreach x in (folder "blog/general") sortAscendBy .extra2 $}
          <li id="{$x.extra1$}">
            &nbsp;<a href="{$$}">{$x.headline$}</a>
      extra2 ist just my personal sortorder (Numbers)
      extra1 is one, two, three, ....
The CSS Entry is now just

body#home .kopf li#one a,
body#PhotoAlben .kopf li#two a,
body#Archive .kopf li#three a,
body#About .kopf li#four a{
    font-weight: bold;
    text-decoration: underline;

Now the only thing I have to change is my CSS file.
You can look at it at

Paul Vanovertveld
Monday, April 5, 2004


That's a really nice site.

Can I ask what software you are using for you photo gallery?

11 Month Lurker
Monday, April 5, 2004


Citydesk of course.
On my Notebook I use Photomeister (
There is an export function where I can resize the pictures in a  single job. Copy all of them into a new folder  and integrate the folder into citydesk.


Paul Vanovertveld
Tuesday, April 6, 2004

Thanks a lot for all the help. Have anyone seen this feature implemented in any of the templates that are available?

Peter Axelsson
Tuesday, April 6, 2004


Cool, thanks for posting this script. Any ideas on how to skip making the current page a link??  It's a moot point but being picky I'd like to highlight the current selection and remove the ability to select it.


Perpetual Newbie II
Wednesday, April 7, 2004

*  Recent Topics

*  Fog Creek Home