May 04
Over at the EverNote forum, Pam has a question about a To Do template featured in the Template Catalogue. That template, called To Do With Highlight has an interesting property in that when you check off an item, the background of that item is highlighted (or low-lighted, depending on your colour sense.) So, it becomes quiet easy to see the difference between done and not done items in the list. She wanted to know if there was an easy way to accomplish this.
Modifying the To Do List
For this demonstration, I’m going to start with the stand To Do List template. In the EverNote Template Editor, I have opened up my template database. I’ve made a duplicate of the default To Do List template, and, learning from the To Do With Highlight template, I’m going to modify this duplicate.
Missing Resource = Missing Icon
So, here’s what the new template looks like, before I start. You’ll notice that the little checkbox icon is missing from the top left. That’s caused by how the template editor duplicates old templates. It’s a minor inconvenience, and fixable, but you need to go under the hood for that. For this tutorial, we’re going to skip that and simply delete the call to that icon. Delete the highlighted bit, i.e., delete “<IMG src=”todo.png” …>

I’ve highlighted another important part of the template. The red box is the loop that allows you to have as many lines in the body of the template as you like. The inner blue box is the description of the actual row in the code. Remember that <TR></TR> are the tags for a row in a table, and <TD></TD> are the tags for a cell in a row. So this row has two cells, one that holds the To Do item, and one that holds the checkbox, called done.
Disappearing Line Items
First things first. If you play with the To Do List template at all in your database, you’ll notice that when you’ve got some line items checked, and then you lock the note, those done items *disappear*. Actually, they just hide when the note is locked, but come back when you unlock it. This behaviour can be desirable. Or not. Either way, it’s something to think about, since we’ve copied the same code from that template and it’s now in our new template.
If you look at the code snippet below, the pink highlighted parts are the code that controls whether or not a done item is shown in the locked note. If you leave the pink highlighted parts in, checked lines will be hidden in the locked note. If you delete the pink parts, checked notes will be shown in the locked note. Since the whole purpose of this exercise is to highlight done items, as opposed to hiding them, we’re going to delete those lines.

Highlighting Line Items
Okay, now for the good stuff. Look at the code snippet above, the yellow highlighted parts are the stuff that we add to the template in order to highlight the checked lines. Basically, instead of just echoing the to do item, we’re putting in an if statement. All it does is check to see if that item is marked done. If it is, show it, but show it with a lavender background. If it’s not done, show it with a white background.
The final template code, seen in ENTE, looks like this:

The Template in Use
As with most templates, the locked and unlocked versions look different. Here’s what the template looks like after locking/unlocking. (Sometimes locking is necessary to kick the code into working order.) Notice that the background of the done item is lavender, even though there’s a white textbox in the way.

And here’s what it looks like locked. Prettier.

You can download the xml file for the To Do (Highlight) template here.
You should be able to use what I’ve shown you to modify some other template that uses checkboxes. And in honour of Star Wars day, May the 4th be with you ;)