Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Templates

I have a question on templates.If i have a number of  ARTICLES and each has a different Author(some might be the same) How can i make each article to point to its own author and each author page link back to its own article?
Please Help me! Some one!

Fauzia Alam
Tuesday, November 19, 2002

I don't think you can use the author field.

Put the author/link in an extra field (eg "About the author")of the article and use a script to grab the author/link.  You can put links in the extra fields.

You can go futher.  If you have a folder with a bio article for each author and the keyword for each one is the author's name, you can use a script to pull stuff out of the author's bio article:

foreach x in (keyword_contains "ArticlesAuthorsName")
$}

I'm sure there are other ways. Maybe the next release will make this easier.

tk
Tuesday, November 19, 2002

it would be better if the author "field" supported links, and if conditions could handle expression like
foreach x in ( .author="john doe")...

But meanwhile, here is a (painful) workaround for the first point:

you can create a site variable for each author, like this
{$ .john_doe $}


create a biography page for each author (e.g. johndoe.html) -  you can "copy the magic name" of this page by right-clicking on it.

Edit the variables values like this:

<a href="magic name of john doe biography page"> john doe <a>

(this is a painful operation, because the window of variable edition needs to be closed before doing anythinbg else... so you have to "copy the magic name" of the bio page before opening this window !)

and so on....

in the author field, dont write just "john doe" but {$.john_doe$} 

And the name of the author will appear with a link to his bio page on the published pages.

It would be nice, in the 2.0 version, if we could edit "author lists" with a list of authors contributing to the site, and, if we want, an associated link to each author's bio page. Like that, article writers could set up the author name just by picking in this list.

(I realize that my english is really awful to read. Sorry !)

vincent benard
Wednesday, November 20, 2002

Actually, what would really be nice is to have a list of authors that can be predefined.  That way, if you have multiple authors, you could select your name from a drop down list.  Also, this would help if someone accidentally mistypes their name.  Yes..it does happen. 

Then when defining an author, you could then define the appropriate bio page, with links being provided automatically. 

Thought this would be a nice enhancement to CityDesk, but thats my opinion... :)

Jeff Kolker
Wednesday, November 20, 2002

Well, it would certainly be nice if all fields where equal in citydesk (now there is a keyword_contains, but no author contains for instance).  Then, if references could have some recursion, it would be possible to do

{$if exists "{$.author$}_bio"$}
  <a href={$link("$_")$}>{$.author$}</a>
{$else$}
  {$.author$}
{$endif$}

(assumption that $_ is a shortcut to the evaluated variable (perl-like). I'm lazy...

Adriaan van den Brand
Thursday, November 21, 2002

*  Recent Topics

*  Fog Creek Home