Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

How to replace assets

Is it possible in CD to replace assets such as
images and other files so that the links in
articles and html don't break?

As a site develops, the graphics are
improved simultaneously ( the "Iceberg Secret",
don't you know  :)  ).  Also, some sites contain
technical .docs or .pdfs that get revised over

Currently, this means adding the new asset
and deleting the old, which invalidates all
references to the object.

This problem puts a big time-sucking damper
on maintenance.  Any ideas?  I hope I'm just
doing something wrong.

Greg Wiley
Tuesday, March 26, 2002

Greg, my problem EXACTLY.

Here's what I do.

Only reference graphics in the templates.

Keep articles and associated assetts (pdfs, graphics, etc.) in the same folder. Every time you need those assetts, it's referenced via the article. I.e. "Here are the 3 PDF's on blah" and you pull them into another page somewhere.

The article stays the same, can be pulled in via loops, and the PDFs can change.

My goal is to get CityDesk to be as robust as the document repository, and to do this I'm thinking of putting summaries in the body and doument links in the extra1 section.

This way I can format it any way I want, the documents can be in a sidebar, or on the bottom of the page, whatever the template calls for.

I'm hoping they add "Files as articles" so that my PDF can have keywords, etc. Essentially the article would have a new field {$.file$}. Then you could create a link to it in a loop by doing

<a href="{$x.file$}">{$x.headline$}</a>

I guess a {$.filetitle$} would be good so you could reference it from the body with it's own name.

Then it would be easy to make an style site. Each "file as article" would have to publish an HTML file AND a file(s). The page with the descriptive stuff, and the file itself.

Mark W
Tuesday, March 26, 2002

An alternative is that you don't have to use the PTMFOG style links. Since the assets are strongly named, reference them by their ultimate name anyway. You lose the free fixup if you move it from one folder to another, but that's more than compensated in your case by the fact that you're more likely to be publishing fixed-up versions than moving (I assume).

Brad Wilson
Thursday, March 28, 2002

Thanks Mark and Brad-

For the short term, using the actual asset
paths is best since the most common operation
is update.  Sure would be nice to have
everything, tho.  :)


Greg Wiley
Thursday, March 28, 2002

*  Recent Topics

*  Fog Creek Home