Header and Footer Formatting

I’d like to add info to my headers, specifically, I’d like to add the chapter title. I have looked at the template editor, and it looked like, if I simply removed two of the hash marks near the top of the file, that it would do what I wanted, but removing those hash marks did nothing. I assume it’s simply a variable, like <$p> provides the page number. Any pointers?

I have, after a couple of hours of mucking around, got it mostly looking the way I want. This stuff really need to be documented. Can’t get the chapter title to show in the heading, despite using the variable names that work elsewhere. Some concise documentation about what is available, and how to use it, would be really handy.