Fog Creek Software
Fog Creek Software

CityDesk 2.0-Documentation
Lesson 4 - Changing the Appearance of Articles

You can change the appearance of all your articles in one place just by changing the template.

*  Make sure Designer Mode is on by selecting View » Designer Mode. When designer mode is on, a row of extra designer tools will appear in the toolbar.

Designer Mode is for controlling the overall site structure. You can turn this off when you are just adding and editing articles, to prevent accidentally making fundamental changes to the structure of your site.

*  Select View » Templates or click on the Templates tool on the tool bar:

Templates
Templates

Can't find the templates tool? Double check that you are in Designer Mode.

*  Double click on the template titled Simple (.html).

A template is an HTML boilerplate document containing all the stuff that is the same for every article which uses it. Any change you make here will change the appearance of each and every article that use the template, automatically. You can have as many templates as you want.

More advanced changes can be made by clicking on HTML View and editing the HTML directly.

CityDesk's built-in editor is sufficient for simple page layouts and for editing articles. But for designing templates, you may want to use a more sophisticated HTML editor such as Macromedia Dreamweaver, Microsoft FrontPage, etc. To use any external editor that is registered on your system, just right click on the icon for the template itself in the Templates window. A pop-up menu will appear allowing you to choose an external editor. If your favorite editor is not listed, you can add it using the Choose Program menu item.

Everything you see between {$ and  $} is a CityScript element that will be replaced when you publish your site. CityScript is CityDesk's built-in scripting language. It's very easy to learn and you don't have to be a programmer.

For example, {$.headline$} will be replaced by the actual headline of each article. (The article's headline comes from the Properties tab in the article editor.) {$.body$} is replaced by the main text of the article.

CityScript also lets you create variables. Variables represent chunks of text that can be changed in one place, affecting the entire site. For example, a company's name might appear on every page of the site, represented by a variable. In the case of a merger, buy-out, or if the name turns out to be obnoxious in Basque, the company's name can be changed just once on the variable list and this change will be reflected everywhere it appears on the site. In this template, we use two variables: {$ .SiteName $} and {$ .TagLine $}.

*  Close the Simple Template window and the Templates window beneath it.

*  Next: Lesson 5 - Changing the Front Page

CityDesk Documentation -  Home


 ©Copyright 2001-2003 Fog Creek Software, Inc. All Rights Reserved.