Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

managing variables

I find that a lot of my HTML ends up in variables.  This happens because I have a lot of similar templates and don't want to repeat anything.  Each of these variables ends up being built up from variables.  In short, I have a lot of variables.

1. Do other people have this experience?  Is there some other way to manage repetition?

2. Given that I have a lot of variables, I find the variable editor kind of frustrating.  Here's a short list of what I'd like

- Some way to organize the variables (folders would be great--being able to sort them would be ok--then I'd just name them appropriately)

- The editor for variable is useless when you have multiline values.  I press enter and the window goes away.  There is no copy/replace, no HTML preview.  I want the regular CityDesk editor here.

- The variables window is modal and non-resizable.  I frequently want to view more than one variable at the same time and copy magic names into them.  Can't get to the other parts of the UI because the window is modal.  Also, I have a lot of variables, and I want to see them all.

Lou Franco
Monday, March 3, 2003

ctl-Enter works to move you to the next line

joel Goldstick
Monday, March 3, 2003

Yeah, the variables kind of suck the way they're implemented now. All I can say is use CTRL+A, CTRL+C and CTRL+V (Thats, Select All, Copy, and Paste respectively) to copy into and out of another HTML editor... Even a CityDesk article created expressely for the purpose.
Monday, March 3, 2003

Cool tip Lou.
Monday, March 3, 2003

I'm now experimenting with using articles instead of variables.  There are mechanisms for bringing parts of articles into templates.  Anybody ever try this?  Any luck?

My main problem is that I want the navigation to change per page depending on the folder.  The rest of the template is the same.  Imagine (tab interface) to parts of the site.  All of the pages are the same except how the tab shows up.  I do not have CGI on my host.  I'd prefer no JavaScript. 

Maybe there's a better way that I haven't thought of yet?

Lou Franco
Monday, March 3, 2003

Thanks Joel for the Ctrl-enter tip, that helps a lot.  Too bad ctrl-a doesn't work in variables.  Oh well.

Lou Franco
Monday, March 3, 2003

Ok, found this which mentions the same idea.

Now I just have one problem.  I want to keep an article called tabs in each directory.  How do I make a write a script that only includes articles in the same directory as the article being published.  (folder ".") does not work.  I want to put this in a template and use it for all articles, so I cannot put a specific folder name.

Lou Franco
Monday, March 3, 2003

Selecting articles from the "Current folder" has been a frequent request.

Monday, March 3, 2003

You can put in a

{$ foreach 1 x in (filename "tab home") $}

in your article/template.
Monday, March 3, 2003

You can also use a TAB keyword and select the articles in the folder and keyword contains TAB.

David Burch
Monday, March 3, 2003

*  Recent Topics

*  Fog Creek Home