Rebuilding a Portfolio

16 July 2003

16 comments

There’s a wholelotta recent buzz around using Movable Type for more than just weblogs. In addition to the comments and tips Jay Allen has been providing here on Adaptive Path’s MT use, Matt Haughey gives us some great insight into how he takes advantage of MT’s flexibility in Beyond the Blog. Just before reading Matt’s piece, I followed Jay’s pointer to Brad Choate’s Doing your whole site with MT. Both of these are interesting reads given my recent foray into the use of MT to power portions of this site.

In particular, Matt’s example of creating an online portfolio grabbed my attention. Amid all the hubbub around the Adaptive Path redesign last week, I quietly launched my own portfolio redesign, after taking it offline for three weeks while switching stopdesign.com over to a UNIX server and a new hosting service. I pushed some pieces around and made adjustments to clean up the interface. I also rewrote a lot of the relevant style sheet rules, and implemented a new CSS rollover technique to be covered in a forthcoming tutorial (the rollover is turned off for IE5/Mac). In addition to the visual changes, the entire portfolio is now controlled by Movable Type.

My old portfolio used an Access database and a bunch of custom-built ASP functions which generated dynamic pages based on one default.asp file and a set of query strings. My intent was to port everything over to MySQL, and use a beginning knowledge of PHP to do the same thing ASP used to do. This would have taken me several weekends of stumbling through trial-and-error coding and experimentation. Not something I was looking forward to tackling. Once I finished switching over to MT for my log, I became convinced it could be used to help get my portfolio back online as quickly and painlessly as possible. I started by creating a new blog in MT named Stopdesign Portfolio. Here’s an overview of how I use the Entry fields in MT, and how it’s all put together:

  • Title = Full Title of a Piece
    The full title of each piece actually consists of two parts: a name and a type, which I split up into two visual chunks on each page. I use the Title field for the full title, then break the two pieces up later on in Extended Entry. For example, a full title would be “Adaptive Path Site Redesign”, even though it’s split up later into “Adaptive Path” and “Site Redesign”.
  • Primary Category = Category
    My portfolio pieces were already divided into eight categories. This was the first indication to me that MT could probably be used to setup my portfolio, along with noting that each piece had a similar set of data fields. I added my existing categories to MT: Advertising, Annual Reports, Books, etc.
  • Entry Body = Piece Description
    The bulk of descriptive text for each piece. For instance, “Adaptive Path is a hugely successful…”.
  • Extended Entry = Extra Key/Value Pairs
    I could have used Brad Choate’s Key Values Plugin for this. However, I decided to throw my values directly into PHP variables. The variables store extra information like client, main image width/height, number of full-size versions available ($fsavail), whether the image and description should be stacked on top of each other, and any additional notes. This is also where I assign two additional variables which split up the full title into name and type. (I realize this is redundant data, but it gives me the flexibility to call each piece separately, and still have search results display the full title as the result title should I ever decide to implement a portfolio search someday.) A sample Extended Entry for the Adaptive Path redesign looks like this:

    $pname = 'Adaptive Path';
    $ptype = 'Site Redesign';

    $client = 'Adaptive Path';
    $note1 = '';
    $note2 = '';

    $pwidth = 184;
    $pheight = 169;
    $fsavail = 3;
    $stacked = false;

  • Excerpt = Short Name
    I didn’t want to rely on the main Title (which can sometimes get long) to create a logical file name for each entry. I also didn’t want to use either of my title variables ($pname and $ptype) because they may not be descriptive enough. The excerpt is used to create a custom file name for each piece. The dirify attribute is used to make all letters lowercase, and replace all spaces with underscores, and each file is automatically placed in a directory according to its own category. For instance, /web_interface/adaptive_path.html
  • Keywords = Name ID
    The Name ID was my original convention of assigning unique IDs to each piece in the old portfolio version. It’s a string that starts with the first three letters of the category, followed by a short, recognizable name for that piece. I could have added this to the variables stored in Extended Entry, but I wanted frequent access to this ID in multiple files and functions, without needing to include all the other variables, or globalize this one every time. In this version, it’s used purely for calling the right images, and assigning IDs to the thumbnails for the rollover effect. For instance, the Adaptive Path redesign uses “web_path”.
  • Authored On Timestamp = Priority/Sort Order
    I list this one last, because it was the final piece of the equation which took me a while to put together. The concept is simple. I wanted a means to prioritize pieces within each category (so that certain pieces would always appear first in a category) regardless of their auto-assigned entry ID. I also wanted a controlled way to guide the user through every piece of the portfolio, one piece at a time — like a slide show — via a simple “Next” link. MT already sorts entries automatically by date. Once I realized I could use the date, a whole new level of sort control opened up.

    Since the date consists of six different parts (year, month, day, hour, minute, second), I use pieces of the timestamp to control not only the order within one category, but also the order of the entire portfolio. I use the month for a category number, and the day for the sort order within each category. I have a small enough number of pieces in each category that renumbering would never be a problem when I decide to remove a piece or add a new one.

    I just need to remember that more recent entry dates get rendered first, and oldest dates get rendered last, just like a weblog. This conveniently displays each piece in the MT Edit Entries interface in the same order it appears on the site.

I use the Category Archive Template to spit out one include for each category. Each include contains the square thumbnail images of each piece in that category. The includes are PHP fragments, containing their own logic to determine the current highlighted thumbnail (uses <strong> rather than <a>). Using one include for each category eliminates the need for MT to constantly recreate the same thumbnail set for every piece, just like producing one monthly calendar include for each month of a weblog avoids recreating it for every entry. While the includes are being produced for each category, I also build an array which allows me to match the current piece’s ID to an ordinal number (used for “No. n of total pieces in this category”). Then I can use MTEntryCategory to call the correct thumbnail include for each piece.

The extra variables in Extended Entry are placed at the beginning of each file for use at any time. The number of full size images available is used to determine how many (and which) magnifying glass icons to render. If available, full-size versions are swapped into the same file using a simple query string.

I use one Index Template to produce the list of categories, along with the number of pieces in each category. This list is published as a single fragment, then called in as an include for display on every portfolio page. Again, this list contains its own logic to determine which category should be highlighted as the current category.

What I thought might take several weeks to complete, ended up taking the second half of my July 4th weekend. Two days from start to finish. Removing a piece is now as simple as changing entry status from “Publish” to “Draft”. Inserting a piece anywhere in the sort order is extremely easy using an altered timestamp. A rebuild of the entire portfolio section takes about 4 seconds. My whole portfolio is now accessible and editable through the MT interface.

Another example exploiting Movable Type’s flexibility to manage multiple pieces of content on small-scale sites.

Posted in MovableType, Site, Technology

16 comments (Comments closed)

1. At 10:01am on 16 jul 2003, avianto wrote:

Thanks for the insight. Been thinking to redone my own portfolio with MT (after reading Matt Haughey’s entry) and your entry now really help me a lot. Thanks again.

2. At 10:58am on 16 jul 2003, Paul Scrivens wrote:

It’s nice to see someone extending a product to new boundaries and then providing us the resources to show us how its done. Greatly appreciated.

3. At 11:22am on 16 jul 2003, Mike wrote:

Very cool Doug.

I’m doing something similar to that, however mine isn’t as intricute.

Instead of making an entirely new blog consisting of my portfolio, I simply have the category “Portfolio” and only reference that on my portfolio pages.

Easier to implement on a small-scale portfolio such as mine ;)

4. At 1:31pm on 16 jul 2003, Dan Rubin wrote:

I love what you’re doing with MT — we’ve been playing around with it for some time, but have been holding back when it comes to using it for clients’ projects, with the hope of MT Pro being released, but I think we’re going to change that policy right now.

If it’s good enough for StopDesign and AdaptivePath, it’s good enough for our clients :-)

The one thing we will need MT Pro for is author permissions regarding Publish rights — we’d love to allow multiple authors to edit content, but set only certain users to publish the content to the live site. Any ideas on how to hack MT directly? Maybe I’ll luck out and Jay Allen will read this and have an idea…

5. At 2:48pm on 16 jul 2003, Paul Michael Smith wrote:

Doug, are you ever away from your computer mate ? You seem to get a hell of a lot done. ;-) Makes me jelous.

6. At 5:43pm on 16 jul 2003, huphtur wrote:

doug: the new rollover crashes my browsers (firebird 0.6)

7. At 6:10pm on 16 jul 2003, Doug wrote:

Huphtur: I saw your note to Jay in a previous comment about the rollovers on his site crashing your browser as well. The rollovers on Jay’s site and the ones in my portfolio are implemented using completely different methods. His use JavaScript, mine use CSS. I’ve tested both sites in Firebird 0.6 on two different systems, and I haven’t seen one problem yet.

If you continue to have this problem, you must have a very unstable build of Firebird. Simple rollovers should not crash your browser. If you installed a new version of Firebird over an old version without deleting all old files first, the installation instructions warn that you WILL have problems. If I were you, I’d revisit Mozilla’s Firebird page, and do exactly as the instructions recommend. Might save you a lot of headaches in the future.

8. At 6:38pm on 16 jul 2003, Doug wrote:

Dan: The one thing we will need MT Pro for is author permissions regarding Publish rights — we’d love to allow multiple authors to edit content, but set only certain users to publish the content to the live site.

Unless Jay or someone else knows of a solution, this doesn’t seem possible in the current version of MT. There is currently no separation in concept between saving changes to a “Published” entry in the MT database (i.e. a temporary local save), and re-publishing entry edits to the live site. They happen at the same time. If an entry still exists in “Draft” status, then it seems possible, though I haven’t figured out the permissions checkbox combination to make it possible. This would also require an entry to already be in (or be set back to) “Draft” status anyway, which isn’t really an acceptable solution.

Despite the confusion between “look” and “girlie” on definitions, this MT forum topic may help clarify the situation: Problem with editor permissions. Sounds like “look” wants the same thing, and that you’re right: we’ll have to wait for MT Pro’s Author Management feature.

9. At 11:12pm on 16 jul 2003, huphtur wrote:

doug & jay: my apologies, i did have a faulty firebird build. i installed the latest nightly build and both doug’s and jay’s rollover now work. sorry about the ‘false’ bug reporting.

10. At 11:30am on 17 jul 2003, alexBuda wrote:

FRAMES
Doug, I need your help and sugestion (and of who else can give me some light on this).

Today I went to http://exp.hicksdesign.co.uk from a Zeldman note. So far so good. How ever, is the frame effect Standard?

You see I wanted to use that effect for same time now…

Can you give me some light?

Keep up the good work!

11. At 12:21pm on 17 jul 2003, Beto wrote:

You have answered my prayers!!! For years, the portfolio section has been my biggest headache when redesigning my site, because of the sheer number of entries and my lack of knee-deep MySQL knowledge to come up with a better solution. Even ventured into Flash and XML for a while, but never got satisfied with any of these. But I do have and know MT… can’t wait to start implementing this one on my forthcoming design.

12. At 4:44pm on 17 jul 2003, huphtur wrote:

re #10: alex,
those are not frames.
its simple div tag with overflow:auto;
also used here: http://etnies.com/bmx/team/ruben.alcantara/
(validates correctly)

13. At 10:38am on 18 jul 2003, Robert Denton wrote:

one way to limit publish/draft is to have a staging site and a production site.

I edit the menu.tmpl and add js logic to write out a URL particular to each blog which calls a cgi shell script (basically rsync and a few other things) to make the changes “live” — currently this is available to any author of the “blog” but it’s not a stretch to think of making another page linked in with authorization which then linked to the publish script.

14. At 12:17pm on 20 jul 2003, Submunition wrote:

I am glad to see the amount of thought that people have put into the topic of extending MT. I have been experimenting with it for a number of different projects, and the ideas presented here really help.

I am trying to decide if it is worth it to set up a blog for each section of my site, with a sort of master template that they will all conform too.

Its exciting and overwhelming, there are so many ways to do this, and so many applications of the Movable Type tool that it is starting to boggle the mind.

It’s probably high time I finished the MT flash interface…MMMM…

15. At 11:06pm on 21 jul 2003, eric! wrote:

your writeup was a pretty interesting read… i JUST redid my own portfolio about two weeks ago with a similar method. my requirements are slightly different, so i’m using the fields for different things, but the result is pretty similar.

the new porfolio is miles easier to update than my old directory-driven PHP system, and entries have absolute links now. when used with zempt it’s almost too easy to use.

16. At 7:48am on 14 jan 2004, Johan Sahlen wrote:

I’ve just created my first site using MT, and I wanted to use it for more than just the blog. I took on a different approach though. I found the excellent plugin/hack ExtraFields, which allows you to add any number of fields you want, and you can name them whatever you want. The downside is you need some basic knowledge of MySQL. I use it to post a movie reviews blog. I have a field called ‘Rating’ where I can enter a number, which I use in the MT template to show n amount of stars.
I decided not to use MT for the portfolio though, as I want to be able to upload an image + a thumbnail directly from the browser. MT’s upload file function is just inferior as of yet (in terms of not being able to set defaults, like upload folders and such), but I’m keeping my fingers crossed for a batch upload plugin or something to that effect. Until then I’ll just use the simple PHP/MySQL setup I wrote, but MT really has a lot of potential to be a quite complete CMS.

Comments no longer open for this entry.

| Next entry


Upcoming Events

View all Events

Recent Entries

Latest links Subscribe to Stopdesign's Links feed

View all links

The easy way to manage projects: Basecamp
Recommended without hesitation for easy, web-based project management software.

118