CityDesk 2.0-Documentation
Linking from Contents to the ArticleThere are two ways to link from the table of contents to an article, depending on whether you want an entire field to serve as the link (for example, the headline), or just a part of the field (for example, a couple of words from the teaser).
To link from an entire field to the article:
Edit the file where the table of contents appears in HTML View.
Inside the foreach loop, create an <A> tag, where the href attribute comes from CityScript code that extracts the link. For example:
{$ forEach x in (all) $}
<a href="{$x.link$}">{$x.headline$}</a><br>
{$ next $}This will create a list of headlines, where each headline is a link to the article.
To link from a part of the field to the article:
Do not create an <A> tag in the template. Simply include one of the fields in the table of contents. This example displays the teaser field:
{$ forEach x in (all) $}
<p>{$x.teaser$}</p>
{$ next $}
For each article, using the article editor, surround the part of the field that you want to be a link with [[ and ]]. For example:
Kids make nutritious snacks, according to reporter Jean Hackcough. [[Read more.]]
At publish time, the [[ and ]] will be replaced with approprate <A> links to the article. This puts the burden on the person who creates the article to decide which part of each article's teaser will serve as a link.
©Copyright 2001-2003 Fog Creek Software, Inc. All Rights Reserved.