John Hesch

Echoing my thoughts and interests

Part 1, Part 2, Part 3, Part 4

Tonight I created an open project page that displays the current projects I'm working on with all the notes, ideas, reference links and other data.

At first I was going to use custom fields to display some of the data for the project but after playing around with custom fields it was more work to add the custom field then to enter the information into the actual posting.

The open project page is similar to a WordPress index page but it displays only category 34, which is my open_project category. I did this by entering:

PHP:
  1.  
  2. if (!isset($cat))
  3. $cat = 34;
  4.  

right before the wp-blog-header include statement. This instructs the page to only display the open_projects category. I also replaced the_content() with the_excerpt() because I want a short list of open projects. I can click on the permalink title to get to the details if I want. When a project is completed it will be recategorized to closed_projects and will no longer show up on the open projects page.

I edited the quicktags.js file so I can easily create an open project template when writing a new post. You'll see that all of the open projects have the same format:

HTML:
  1.  
  2. <strong>Project:</strong>
  3. <strong>Project Details:</strong>
  4. <strong>Action Items:</strong>
  5.  

In quicktags.js I added the following code:

JavaScript:
  1.  
  2. //----- Begin template hack
  3. edButtons[edButtons.length] =
  4. new edButton('ed_project'
  5. ,'Project'
  6. ,'<strong>Project:</strong>\n\n\n<strong>Project Details:</strong>\n\n\n'
  7. ,'<strong>Action Items:</strong>\n'
  8. ,''
  9. );
  10. //-------End template hack
  11.  

Here's a quick explanation of what's happening.

JavaScript:
  1. new edButton('ed_project'

The name of the new element. This must be a unique name.

JavaScript:
  1. ,'Project'

The name of the Quick Tag button.

JavaScript:
  1. ,'<strong>Project:</strong>\n\n\n<strong>Project Details:</strong>\n\n\n'

This is what is entered when the Project button is clicked the first time. The \n creates a blank line, similar to a paragraph tag.

JavaScript:
  1. ,'<strong>Action Items:</strong>\n'

This is what will appear when the Project button is clicked a second time (closed).

I now have a new button called Projects on my write post page along with the other Quick tags. Clicking on Project creates my template.

I'm sure I will be creating additional Write templates as I begin to use my PIM.

I have a couple projects listed if you would like to see how I'm using this page.

I also installed the Auto-hyperlink URLs plugin so that I can copy and paste URLs without having to manually linkify them. This will save me some time.

The majority of the work is now completed on my PIM. I'm pretty happy with the results. There are few more features I would like to add so I'll wrap up this series on creating my personal information manager tomorrow.

  1. Andrea Said,

    What a great idea! I didn’t think of using the Quick Tags for templates. Shall try that one out.

  2. Curiouser - Something about Everything Said,

    anything you need quick access to (my Shortcuts folder currently contains 23 programs and files with very easy to remember abbreviations), but I found it worth mentioning anyway. Use Quicktags to create post templates I came across this trick in a post on using WordPress as a personal information manager (it’s not just me!) and had to try it out right away. The linked entry offers a step-by-step tutorial, so here’s just the gist: in the quicktags.js file, include some code to create a template button; when triggered it will insert the given string

Graytone | Design: Tenant Report

Welcome to johnhesch.com, a blog about my life, projects, and interests. I have been blogging for over 10 years in one form or another.