Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Keeping Track Of Templates

For those that are interested, I've documented the method I use to keep track of my site's templates. I find it handy to remember which fields end up where on the final rendered pages.

http://www.pool-room.com/CodeCraft/CityDesk/fog0000000095.html

This technique would be especially handy for people who set sites up for not-so-computer-literate friends or clients. Printing each page out gives them a ready reference to help them remember which fields they need to fill out when they add articles, or which fields to edit to fix errors.

Feedback is welcome!

Darren Collins
Thursday, January 31, 2002

Nice!

Joel Spolsky
Friday, February 01, 2002

Sweet.

An alternate method, that also prevents browsing, is to copy/paste the template into a .txt file, or other extention that doesn't get parsed.

This way you have a folder with a bunch of .txt files with your templates, but no index of them. =(

Also, doesn't your method have the added disadvantage of you loosing the {$ foreach x in (all) $} stuff?

Mark W
Saturday, February 02, 2002

You're right, foreach stuff is still evaluated on my example pages. I intended that, because I just want to show people where the article fields are inserted in the final page.

The users I have in mind don't maintain the templates or scripts. They're better off just knowing that the Plant template has a list of plants across the top, rather than wondering what all that gobbledygook does (have a look at http://www.pool-room.com/CodeCraft/CityDesk/Templates/fog0000000101.html to see what I mean).

Darren Collins
Sunday, February 03, 2002

What I need to know is which template goes with which article.  I could add it to Mark's "keeping up with keywords/filedate/authors etc. script.

tk
Sunday, February 03, 2002

Ah, a new field "Template" to go along with "Author" "Body" etc. seems to make sense. Then you could put some code at the top of your page like this:

<meta name="template" content="{$.template$}">

and you would always know what template you were using just by viewing the source code.

In fact, this seems like good practice in general. I think I'll add the following code to all of my templates:

<meta name="filename" content="{$.filename$}">
<meta name="fileddate" content="{$.fileddate">
<meta name="author" content="{$.author">

to help me keep track of 'em. Now by simply viewing the source I can know the exact filename, fileddate and author. Hopefully I'll already know the folder based on the site structure.

Mark W
Monday, February 04, 2002

Yes, I think {$.template$} would suit me fine.

tk
Monday, February 04, 2002

*  Recent Topics

*  Fog Creek Home