Category Archives: WordPress

Using WordPress as a Syllabus Database: Learning is Fun

(More screenshots in a previous post on this blog.)

Worked on a WordPress project all night, the night before last. Was able to put together a preliminary version of a syllabus database that I’ve been meaning to build for an academic association with which I’m working.

There are some remaining bugs to solve but, I must say, I’m rather pleased with the results so far. In fact, I’ve been able to solve the most obvious bugs rather quickly, last night.

More importantly, I’ve learnt a lot. And I think I can build a lot of things on top of that learning experience.

Part of the inspiration comes from Kyle Jones’s blogpost about a “staff directory”. In addition, Justin Tadlock has had a large (and positive) impact on my learning process, either through his WordPress-related blogposts about custom post types and his work on the Hybrid Theme (especially through the amazing support forums). Not to mention WordCamp Montrealofficial documentationplugin pagestutorials, and a lot of forum– and blogposts about diverse things surrounding WordPress (including CSS).

I got a lot of indirect help and I wouldn’t have been able to go very far in my project without that help. But, basically, it’s been a learning experience for me as an individual. I’m sure more skilled people would have been able to whip this up in no time.

Thing is, it’s been fun. Close to Csíkszentmihályi’s notion of “flow”. (Philippe’s a friend of mine who did research on flow and videogames. He’s the one who first introduced me to “flow”, in this sense.)

So, how did I achieve this? Well, through both plugins and theme files.

To create this database, I’ve originally been using three plugins from More Plugins: More Fields, More Taxonomies, and More Types. Had also done so in my previous attempt at a content database. At the time, these plugins helped me in several ways. But, with the current WordPress release (3.2.1), the current versions of these plugins (2.0.5.2, 1.0.1, and 1.1.1b1, respectively) are a bit buggy.

In fact, I ended up coding my custom taxonomies “from scratch”, after running into apparent problems with the More Taxonomies plugin. Eventually did the same thing with my “Syllabus” post type, replacing More Types. Wasn’t very difficult and it solved some rather tricky bugs.

Naïvely, I thought that the plugins’ export function would actually create that code, so I’d be able to put it in my own files and get rid of that plugin. But it’s not the case. Doh! Unfortunately, the support forums don’t seem so helpful either, with many questions left unanswered. So I wouldn’t really recommend these plugins apart from their pedagogical value.

The plugins were useful in helping me get around some “conceptual” issues, but it seems safer and more practical to code things from scratch, at least with taxonomies and custom post types. For “custom metaboxes”, I’m not sure I’ll have as easy a time replacing More Fields as I did replacing More Taxonomies and More Types. (More Fields helps create custom fields in the post editing interface.)

Besides the More Plugins, I’m only using two other plugins: Jonathan Christopher’s Attachments and the very versatile google doc embedder (gde) by Kevin Davis.

Attachments provides an easy way to attach files to a post and, importantly, its plugin page provides usable notes about implementation which greatly helped me in my learning process. I think I could code in some of that plugin’s functionality, now that I get a better idea of how WordPress attachments work. But it seems not to be too buggy so I’ll probably keep it.

As its name does not imply, gde can embed any file from a rather large array of file types: Adobe Reader (PDF), Microsoft Office (doc/docx, ppt/pptx/pps, xsl/xslx), and iWork Pages, along with multipage image files (tiff, Adobe Illustrator, Photoshop, SVG, EPS/PS…). The file format support comes from Google Docs Viewer (hence the plugin name).

In fact, I just realized that GDV supports zip and RAR archives. Had heard (from Gina Trapani) of that archive support in Gmail but didn’t realize it applied to GDV. Tried displaying a zip file through gde, last night, and it didn’t work. Posted something about this on the plugin’s forum and “k3davis” already fixed this, mentioning me in the 2.2 release notes.

Allowing the display of archives might be very useful, in this case. It’s fairly easily to get people to put files in a zip archive and upload it. In fact, several mail clients do all of this automatically, so there’s probably a way to get documents through emailed zip files and display the content along with the syllabus.

So, a cool plugin became cooler.

Syllabus Database (archive)

GDE Error: Unable to load profile settings

As it so happens, gde is already installed on the academic site for which I’m building this very same syllabus database. In that case, I’ve been using gde to embed PDF files (for instance, in this page providing web enhancements page for an article in the association’s journal). So I knew it could be useful in terms of displaying course outlines and such, within individual pages of the syllabus database.

What I wasn’t sure I could do is programmatically embed files added to a syllabus page. In other words, I knew I could display these files using some shortcode on appropriate files’ URLs (including those of attached files). What I wasn’t sure how to do (and had a hard time figuring out) is how to send these URLs from a field in the database: I knew how to manually enter the code, but I didn’t know how to automatically display the results of the code when a link is entered in the right place.

The reason this matters is that I would like “normal human beings” (i.e., noncoders and, mostly, nongeeks) to enter the relevant information for their syllabi. One of WordPress’s advantages is the fact that, despite its power, it’s very easy to get nongeeks to do neat things with it. I’d like the syllabus database to be this type of neat thing.

The Attachmentsplugin helps, but still isn’t completely ideal. It does allow for drag-and-drop upload and it does provide a minimalist interface for attaching uploaded files to blogposts.

First Attach Button (Screenshot)
Screenshot of First “Attach” Button

In the first case, it’s just a matter of clicking the Attach button and dropping a file in the appropriate field. In the second case, it’s a matter of clicking another Attachbutton.

Second Attach Button (Screenshot)
Screenshot of the Second “Attach” Button

The problem is between these two Attach buttons.

File Uploaded Screenshot
Screenshot of the Uploaded File

The part of the process between uploading the file and finding the Attach button takes several nonobvious  steps. After the file has been uploaded, the most obvious buttons are Insert into Post and Save all changes, neither of which sounds particularly useful in this context. But Save all changes is the one which should be clicked.

To get to the second Attach button, I first need to go to the Media Library a second time. Recently uploaded images are showing.

Images Only Screenshot
Screenshot of the Media Library Only Showing Images

For other types of files, I then click All Types, which shows a reverse chronological list of all recently uploaded files (older files can be found through the Search Media field). I then click on the Show link associated with a given file (most likely, the most recent upload, which is the first in the list).

Second Attach Button (Screenshot)
Screenshot of the second “Attach” Button

Then, finally, the final Attach button shows up.

Clicking it, the file is attached to the current post, which was the reason behind the whole process. Thanks to both gde and Attachments, that file is then displayed along with the rest of the syllabus entry.

It only takes a matter of seconds to minutes, to attach a file (depending on filesize, connection speed, etc.). Not that long. And the media library can be very useful in many ways. But I just imagine myself explaining the process to instructors and other people submitting syllabi for inclusion the the database.

Far from ideal.

A much easier process is the one of adding files by pasting a file URL in a field. Which is exactly what I’ve added as a possibility for a syllabus’s main document (say, the PDF version of the syllabus).

Course Data Screenshot
Screenshot of the Course Data Box

Passing that URL to gde, I can automatically display the document in the document page, as I’m doing with attachments from the media library.  The problem with this, obviously, is that it requires a public URL for the document. The very same “media library” can be used to upload documents. In fact, copying the URL from an uploaded file is easier than finding the “Attach” button as explained previously. But it makes the upload a separate process on the main site. A process which can be taught fairly easily, but a process which isn’t immediately obvious.

I might make use of a DropBox account for just this kind of situation. It’s also a separate process, but it’s one which may be easier for some people.

In the end, I’ll have to see with users what makes the most sense for them.

In the past, I’ve used plugins like  Contact Form 7 (CF7), by Takayuki Miyoshi, and Fast Secure Contact Form (FSCF)  by Mike Challis to try and implement something similar. A major advantage is that they allow for submissions by users who aren’t logged in. This might be a dealmaking feature for either FSCF or CF7, as I don’t necessarily want to create accounts for everyone who might submit a syllabus. Had issues with user registration, in the past. Like attachments, onboarding remains an issue for a lot of people. Also, thanks to yet other plugins like Michael Simpson’s Contact Form to Database (CFDB), it should be possible to make form submissions into pending items in the syllabus database. I’ll be looking into this.

Another solution might be Gravity Forms. Unlike the plugins I’ve mentioned so far, it’s a commercial product. But it sounds like it might offer some rather neat features which may make syllabus submission a much more interesting process. However, it’s meant for a very different use case, which has more to do with “lead data management” and other business-focused usage. I could innovate through its use. But there might be more appropriate solutions.

As is often the case with WordPress, the “There’s a plugin for that” motto can lead to innovation.  Even documenting the process (by blogging it) can be a source of neat ideas.

A set of ideas I’ve had, for this syllabus database, came from looking into the Pods CMS Framework for WordPress. Had heard about Pods CMS through the WordCast Conversations podcast. For several reasons, it sent me on an idea spree and, for days, I was taking copious notes about what could be done. Not only about this syllabus database but about a full “learning object repository” built on top of WordPress. The reason I want to use WordPress is that, not only am I a “fanboi” of Automattic (the organization behind WordPress) but I readily plead guilty to using WordPress as a Golden Hammer. There are multiple ways to build a learning object repository. (Somehow, I’m convinced that some of my Web developing friends that Ruby on Rails is the ideal solution.) But I’ve got many of my more interesting ideas through looking into Pods CMS, a framework for WordPress and I don’t know the first thing about RoR.

Overall, Pods CMS sounds like a neat approach. Its pros and cons make it sound like an interesting alternative to WordPress’s custom post types for certain projects, as well as a significant shift from the main ways WordPress is used. During WordCamp Montreal, people I asked about it were wary of Pods. I eventually thought I would wait for version 2.0 to come out before investing significant effort in it.

In the meantime, what I’ve built is a useful base knowledge of how to use WordPress as a content database.

Can’t wait to finish adding features and fixing bugs, so I can release it to the academic organization. I’m sure they’ll enjoy it.

Even if they don’t ever use it, I’ve gained a lot of practical insight into how to do such things. It may be obvious to others but it does wonders to my satisfaction levels.

I’m truly in flow!

iCloud Dreams

Got lots more to blog, including something about “received knowledge”. And a list of things I love about Google. (I’m also getting started on “logical punctuation”, as you may already be noticing…)

But, at the risk of attracting trolls and Apple haters, I thought I’d post some notes from a daydreaming session. In some ways, it’s easier to write than the rest. And it’s more “time-sensitive”, in that my thoughts will likely sound very silly, very soon.

But I don’t care.

So, yes, this post is about iCloud, which will be officially unveiled in a few hours. No, it doesn’t mean that I expect anything specific from iCloud or that I trust Apple to deliver something awesome.

Contrary to what some people seem to think, I’m no Apple fanboi. I use a number of Apple products and I find several of them to be close to the ideal in my workflow, but I don’t have any sort of deep involvement in “the Cult of Mac”, Apple Inc., AAPL, or even Apple-focused development. I use the tools and like them, but I don’t think Apple will save us any more than will Facebook, Dell, Google, Amazon, Twitter, HP, or Microsoft.

[Automattic, on the other hand… 😉 ]

So, back to iCloud…

According to many, “cloud computing” (whatever that means) is a domain in which Apple has been relatively weak. I tend to share that opinion, despite the fact that a number of tools that I use have to do with either “the cloud”, Apple, or both. What might give trolls and haters some ammo is that I do have a MobileMe subscription. But there’s a lot I dislike about it and the only features I really find valuable are “over-the-air” syncing (henceforth “OTA”) and “Find My iPhone”. And since I use GSync on my iPod touch, MobileMe’s OTA isn’t that incredibly important. Depending on what iCloud may be, my MobileMe renewal (which comes up in a few days) could be a very hard sell. I don’t regret having it as it did help me retrieve my iPad. But it’s rather expensive if it’s the only thing it does. (Then again, so is insurance of any kind, but I digress…)

So, I’m no MobileMe poweruser. Why would I care about iCloud?

In some ways, I don’t. Or, at least, I didn’t. Until very recently, though I saw rumours about Apple’s new “cloud services”, I was only vaguely intrigued about it. I did think that it might solve my MobileMe issue. But I treated these rumours with a lot of skepticism and a rather low level of interest.

Yet, today, iCloud has been giving me a drift-off moment. Like Android did, at some point.

It’s not that I have predictions to make about iCloud. I’m not even speculating, really. But it got me to think. And, I admit, I enjoy thinking.

Without further ado (about nothing), my fanciful thoughts stemming from a short daydreaming session about iCloud…

The main thing people seem to be expecting  (based on rumoured negotiations with music publishers) is a music streaming service similar to Music Beta by Google or a digital file storage service similar to Amazon Cloud Drive. Both of these are quite neat and I could see myself using something like this. But it’s not exactly what makes me dream. While iTunes integration might make Apple’s version of a music streaming service somewhat more useful than the others. Besides, rumours have it that, through agreements with the recording industry, iCloud might sync music without requiring long uploads. It’s quite possible that this only works with tracks purchased on iTunes, which would upset those whose expectations are high, but could already be useful to some.

Where I’m beginning to drift off, though, is when I start thinking about OTA for podcasts. It’s been high up on my wishlist, as a feature, and you might say that it’s a pet peeve with iOS devices for podcatching. Having to sync my iPod touch to my main desktop just to have my podcast list up-to-date is a major hassle. Sure, there are apps which sync podcasts OTA. Problem is, they can’t add podcasts to the native iOS media player, which is a dealbreaker in my case. (As absurd as it may sound to others, one reason this is a dealbreaker is that I now listen to everything at doublespeed. Hey, it’s my podcast library and I listen to it as I want, ok?)

So, OTA podcasts would constitute a significant enhancement to my experience. Nothing absolutely required and possibly not that significant for others, but it’d really help me in more ways than one could imagine.

Thing is, syncing my iPod touch isn’t just about podcasts, even though podcatching is my main motivation to sync. After all, I don’t listen to podcasts yet I still sync my iPad. So, what else? Well, backing up is the main other thing, and it might be one of the core reason for Apple’s implicit insistence on syncing. That’d be classic Apple. Data loss can be such a big problem that they’d “do what they can” to prevent users from losing data. Far from perfect, in my experience (I ended up having some problems when I lost my “iTunes Library” file). And quite annoying when it meant that the sync would take a very long time to finish at precisely the point when I’m trying to leave home. But a classic Apple move, even in the way Apple haters may mean it.

So OTA synchronization of the whole iOS device, and not just podcasts or music, would be a definite plus, in this perspective. If it does end up coming with iCloud, it’d provide support to the idea that the tethering of iOS devices to desktop computers is really about ensuring that users back up their devices…

…and stay up to date. Firmware updates aren’t that frequent, but they’re probably a major part of the equation for Apple.

But not so much for me. If OTA podcasts were available, I’d still sync my iOS devices on occasion, through whatever means necessary. In fact, were I to use an Android device, a backup app would be essential, to me. So still not much dreaming from the backup aspect of iCloud.

Although… Sync is much broader than preventing device-specific data loss and making sure your device has the latest firmware.

For one thing, it does encompass some of the aforementioned OTA functionalities in MobileMe. Useful, but still not dreamworthy.

We get a bit closer to a “dream come true” if we talk about Xmarks, a bookmark-sync service originally meant for Firefox.  Sure, it sounds incredibly prosaic. But OTA bookmarks would open up a wide range of possibilities. This is about a qualitative difference from going OTA. In the case of backups, it’s about avoiding an annoyance but, arguably, it’s not really about changing something major about our behaviour. (Then again, maybe it is, with people who don’t back their devices up.) Point is, with something as simple as bookmarks, OTA is “disruptive”. At least, it gets me to daydream. One reason is that:

…no matter how fundamental they have been for the Web, links and bookmarks have yet to find their full value.

Hmm… Ok, perhaps a bit hyperbolic… So let me rephrase…

There’s still a lot to be done with URLs and, as simple as they are, I love thinking about links. Maybe I’m just obsessed with URLs.

As it so happens, I have a full list of thoughts about “link processing” and I’ve already blogged about related topics (on more than one occasion, in different contexts, going back to relatively early blogposts). And I even think social science can help.

I mean, think about it! There’s so much you can do, with links! Much of it is obvious, but I’d argue, rarely discussed. For instance, it’s very clear that we can post links pretty much anywhere. Doing so, we’re sharing their “content”. (In a semiotic sense, links are indices. I wish we can move from the “semantic Web” to the “semiotic Web”. But that’s another issue.) Sharing a link is the basic act of the social Web. It’s so obvious and frequent that it seems not to require discussion”.

Another obvious thing about links: we can measure the number of times they’re followed. In 2011, more than thirty years after hypertext has been introduced as a stable concept, much of the Web’s finances still relies on “clickthroughs”. Seems important.

And there’s a lot of processing which can be done with URLs: shortening them, adding them to “to do” lists, checking them for validity, keeping them in link libraries, archiving their “content”, showing them as external or internal links, preventing them from “rotting away”, showing the wordcount or reading time of the item they “target”, display them as QR codes, abuse them, etc.

As you can notice, it’s easy to get me on a tangent simply thinking about URLs. What’s this have t’do with iCloud, you ask? Probably not much, in terms of the actual service which will be announced at Moscone. But I’ve been dreaming about iCloud as a way to integrate Diigo, Instapaper, Delicious, reddit, digg, Slashdot, StumbleUpon, Spurl, The NethernetXmarks

Hey, I told you I was dreaming! Something as simple as managing, processing, sharing, and archiving links in iCloud could lead to just about anything, in my imagination.

And speaking of Xmarks… It’s now owned by Lastpass, a company which focus on password management. IMHO, some Lastpass-like features could make their way in diverse products, including iCloud. Is this far-fetched? Possibly. But secure handling of passwords can be a major issue in both of Apple’s new operating systems (Mac OS X Lion and iOS5). From “keychains” to SSO, there’s a lot of work to be done which relates to password management, in my mind.

Which leads me to think about authentication in general and the rumours about “deep Twitter integration in iOS 5”. (Not directly related to iCloud, but who knows?) Again, something which can send me (and others) on drift-off moments. What if this integration suddenly made iOS devices more useful in terms of social networking services? Something to ponder, if one has a propensity for pondering.

At the same time, given the relative lack of activity on iTunes Ping, I wouldn’t bet on Twitter integration having that major an impact by itself. Not unlike Google, Apple has a hard time making a mark on the social Web. Now, if Twitter integration does connect to everything else Apple does, it could lead to interesting things. A full-fledged online identity? Access to contacts for not only messaging and photo sharing but for collaboration, group management, and media sharing? Not betting on any of this, but it could be fun. Again, not specific to iCloud, but quite related to “The Cloud”. If Twitter integration is deep enough, in iOS 5, it’d be possible to use iOS devices for “cloud computing”, getting further into the “post-PC era”.

An iCloud feature which is expected by several people, is something like an OTA version of the “iTunes file sharing” feature in iOS. Several apps (especially Apple’s own apps) use iTunes and a USB cable to share files. It was a welcome addition to iTunes 9.1 but it’s rather inconvenient. So many other apps rely on Dropbox for file sharing.

Which leads me to dream about iCloud as a replacement for Dropbox. Sounds extremely unlikely that it’ll have the full Dropbox feature set, especially if one thinks about the “Pro 50” and “Pro 100” plans on Dropbox. But I dream of the day when Apple’s iDisk will compete with Dropbox. Not that I’m convinced it ever will. But it’d make Apple’s devices all the more useful if it did.

Something similar, which isn’t frequently discussed directly, in connection with iCloud rumours, but which would rock: Mozy– or Carbonite-style backup, for Mac OS X machines. Sounds very unlikely that Apple will ever offer something like this but, as crazy as it may sound, the connection between Time Capsule and iCloud would be great if it went that far. From a user’s perspective, the similarities between Time Machine backup and “backing up in the cloud” (à la Mozy/Carbonite) are quite obvious. The advantages of both are clear. And while no hardware announcement is supposed to make its way to the WWDC 2011 keynote, I’d give the Time Capsule some consideration if it provided me with the equivalent of what I currently have with Mozy. Not to mention that Mozy has already sparked some drift-off moments, in me, before they announced their new plans. What if I could have a single service which combines features from Mozy, Time Machine, Dropbox, and YouSendIt?

I even think about the possibilities in terms of web hosting. As it stands, MobileMe does allow for some Web publishing through the iWeb application in its iLife suite. But iWeb has never been a major effort for Apple and it hasn’t been seen a significant update in quite a while. What if iCloud could become a true webhost just like, say… iWeb.com? (Semi-disclaimer: I won a free account with iWeb.com, last Fall, and I host some sites there. I also know some of the people who work there…)

Yet again, I don’t expect this to happen. It’s not speculation, on my part. It’s a daydream.

The reason this makes me dream is that I find all these things to be related and I wish they were integrated more seamlessly. Something about which Apple haters may not care much is the type of integration represented by iTunes. As clunky as iTunes may be, in some respects, it’s quite a success in terms of integrating a lot of different things. In fact, it probably overextended its reach a bit too much and we need to replace it. Apple needs to replace iTunes and we should also replace iTunes in our lives.

Like Gruber, I end up thinking about iCloud in relation to iTunes more than in relation to MobileMe. But I also dream about the ideal cloud service, which would not only sync and backup files between iOS devices, hundreds of millions of iTunes store accounts, and Macs, but replace several of the services for which I’m paying monthly fees.

Here’s to dreaming…

Other parts of this crazy, iCloud-infused daydream, in notes form:

Lost Tags and Categories

Since I moved to this domain (from my main blog on WordPress.com, now redirecting here), one of the main issues on my mind has been the loss of my (oh so previous) categories and tags. Not to mention links. Nothing tragic about this but I made extensive use of classifiers, like tags and categories. Some might say I did too much of it, actually. But the issue probably wasn’t caused by the abundance of tags and categories since a test import of a single blog with very few categories and tags had exactly the same results.

I’ve been investigating the situation. Posted to the WordPress Multisite forum and then to the general WordPress troubleshooting forum. Though it doesn’t seem to be exclusively a multisite issue (I recreated the problem on a single site), the multisite forum is where I received feedback. The method proposed is involved enough that I’ll have to have several free hours to make sure I can implement it. Especially since I already spent several hours on this.

Don’t get me wrong, I love WordPress and the whole process can often be painfree. Besides, similar things can happen on any platform (though sometimes you may get more in “free support,” as long as you “sell eyeballs”). It’s just a bit sad that it didn’t work as planned.

Once that issue is solved, I’ll be adding some features to this blog and might start work on its design. I’m not really one for design, in general, but it’ll serve as a place for experimentation in a broader way than did my old WordPress.com blog.

Moved to My Own Domain

A short post to celebrate the fact that I was able to move my main blog from WordPress.com to my own domain, my own WordPress installation, and even my own URL shortener.

It only took a few minutes (the new blog was already set up, but even that didn’t take long). And it means that I can control pretty much everything. Including all details of the theme (should do this soon), all sorts of plugins (including the one creating short URLs and posting them on Twitter), and everything having to do with the site’s administration.

Of course, I’ll have to reconfigure a few things. For instance, it seems that I’ve lost most of my categories. Might have to reimport everything because of this. And I’ll need to find plugins to get some of the functionalities I had on WordPress.com (such as the “sourcecode” shortcode, for my previous post).

But I still think it’ll work, in the long run.

WordPress as Content Directory: Getting Somewhere

{I tend to ramble a bit. If you just want a step-by-step tutorial, you can skip to here.}

Woohoo!

I feel like I’ve reached a milestone in a project I’ve had in mind, ever since I learnt about Custom Post Types in WordPress 3.0: Using WordPress as a content directory.

The concept may not be so obvious to anyone else, but it’s very clear to me. And probably much clearer for anyone who has any level of WordPress skills (I’m still a kind of WP newbie).

Basically, I’d like to set something up through WordPress to make it easy to create, review, and publish entries in content databases. WordPress is now a Content Management System and the type of “content management” I’d like to enable has to do with something of a directory system.

Why WordPress? Almost glad you asked.

These days, several of the projects on which I work revolve around WordPress. By pure coincidence. Or because WordPress is “teh awsum.” No idea how representative my sample is. But I got to work on WordPress for (among other things): an academic association, an adult learners’ week, an institute for citizenship and social change, and some of my own learning-related projects.

There are people out there arguing about the relative value of WordPress and other Content Management Systems. Sometimes, WordPress may fall short of people’s expectations. Sometimes, the pro-WordPress rhetoric is strong enough to sound like fanboism. But the matter goes beyond marketshare, opinions, and preferences.

In my case, WordPress just happens to be a rather central part of my life, these days. To me, it’s both a question of WordPress being “the right tool for the job” and the work I end up doing being appropriate for WordPress treatment. More than a simple causality (“I use WordPress because of the projects I do” or “I do these projects because I use WordPress”), it’s a complex interaction which involves diverse tools, my skillset, my social networks, and my interests.

Of course, WordPress isn’t perfect nor is it ideal for every situation. There are cases in which it might make much more sense to use another tool (Twitter, TikiWiki, Facebook, Moodle, Tumblr, Drupal..). And there are several things I wish WordPress did more elegantly (such as integrating all dimensions in a single tool). But I frequently end up with WordPress.

Here are some things I like about WordPress:

This last one is where the choice of WordPress for content directories starts making the most sense. Not only is it easy for me to use and build on WordPress but the learning curves are such that it’s easy for me to teach WordPress to others.

A nice example is the post editing interface (same in the software and service). It’s powerful, flexible, and robust, but it’s also very easy to use. It takes a few minutes to learn and is quite sufficient to do a lot of work.

This is exactly where I’m getting to the core idea for my content directories.

I emailed the following description to the digital content editor for the academic organization for which I want to create such content directories:

You know the post editing interface? What if instead of editing posts, someone could edit other types of contents, like syllabi, calls for papers, and teaching resources? What if fields were pretty much like the form I had created for [a committee]? What if submissions could be made by people with a specific role? What if submissions could then be reviewed by other people, with another role? What if display of these items were standardised?

Not exactly sure how clear my vision was in her head, but it’s very clear for me. And it came from different things I’ve seen about custom post types in WordPress 3.0.

For instance, the following post has been quite inspiring:

I almost had a drift-off moment.

But I wasn’t able to wrap my head around all the necessary elements. I perused and read a number of things about custom post types, I tried a few things. But I always got stuck at some point.

Recently, a valuable piece of the puzzle was provided by Kyle Jones (whose blog I follow because of his work on WordPress/BuddyPress in learning, a focus I share).

Setting up a Staff Directory using WordPress Custom Post Types and Plugins | The Corkboard.

As I discussed in the comments to this post, it contained almost everything I needed to make this work. But the two problems Jones mentioned were major hurdles, for me.

After reading that post, though, I decided to investigate further. I eventually got some material which helped me a bit, but it still wasn’t sufficient. Until tonight, I kept running into obstacles which made the process quite difficult.

Then, while trying to solve a problem I was having with Jones’s code, I stumbled upon the following:

Rock-Solid WordPress 3.0 Themes using Custom Post Types | Blancer.com Tutorials and projects.

This post was useful enough that I created a shortlink for it, so I could have it on my iPad and follow along: http://bit.ly/RockSolidCustomWP

By itself, it might not have been sufficient for me to really understand the whole process. And, following that tutorial, I replaced the first bits of code with use of the neat plugins mentioned by Jones in his own tutorial: More Types, More Taxonomies, and More Fields.

I played with this a few times but I can now provide an actual tutorial. I’m now doing the whole thing “from scratch” and will write down all steps.

This is with the WordPress 3.0 blogging software installed on a Bluehost account. (The WordPress.com blogging service doesn’t support custom post types.) I use the default Twenty Ten theme as a parent theme.

Since I use WordPress Multisite, I’m creating a new test blog (in Super Admin->Sites, “Add New”). Of course, this wasn’t required, but it helps me make sure the process is reproducible.

Since I already installed the three “More Plugins” (but they’re not “network activated”) I go in the Plugins menu to activate each of them.

I can now create the new “Product” type, based on that Blancer tutorial. To do so, I go to the “More Types” Settings menu, I click on “Add New Post Type,” and I fill in the following information: post type names (singular and plural) and the thumbnail feature. Other options are set by default.

I also set the “Permalink base” in Advanced settings. Not sure it’s required but it seems to make sense.

I click on the “Save” button at the bottom of the page (forgot to do this, the last time).

I then go to the “More Fields” settings menu to create a custom box for the post editing interface.

I add the box title and change the “Use with post types” options (no use in having this in posts).

(Didn’t forget to click “save,” this time!)

I can now add the “Price” field. To do so, I need to click on the “Edit” link next to the “Product Options” box I just created and add click “Add New Field.”

I add the “Field title” and “Custom field key”:

I set the “Field type” to Number.

I also set the slug for this field.

I then go to the “More Taxonomies” settings menu to add a new product classification.

I click “Add New Taxonomy,” and fill in taxonomy names, allow permalinks, add slug, and show tag cloud.

I also specify that this taxonomy is only used for the “Product” type.

(Save!)

Now, the rest is more directly taken from the Blancer tutorial. But instead of copy-paste, I added the files directly to a Twenty Ten child theme. The files are available in this archive.

Here’s the style.css code:

/*
Theme Name: Product Directory
Theme URI: http://enkerli.com/
Description: A product directory child theme based on Kyle Jones, Blancer, and Twenty Ten
Author: Alexandre Enkerli
Version: 0.1
Template: twentyten
*/
@import url("../twentyten/style.css");

The code for functions.php:

<!--?php /**  * ProductDir functions and definitions  * @package WordPress  * @subpackage Product_Directory  * @since Product Directory 0.1  */ /*Custom Columns*/ add_filter("manage_edit-product_columns", "prod_edit_columns"); add_action("manage_posts_custom_column",  "prod_custom_columns"); function prod_edit_columns($columns){ 		$columns = array( 			"cb" =--> "<input type="\&quot;checkbox\&quot;" />",
			"title" => "Product Title",
			"description" => "Description",
			"price" => "Price",
			"catalog" => "Catalog",
		);

		return $columns;
}

function prod_custom_columns($column){
		global $post;
		switch ($column)
		{
			case "description":
				the_excerpt();
				break;
			case "price":
				$custom = get_post_custom();
				echo $custom["price"][0];
				break;
			case "catalog":
				echo get_the_term_list($post->ID, 'catalog', '', ', ','');
				break;
		}
}
?>

And the code in single-product.php:

<!--?php /**  * Template Name: Product - Single  * The Template for displaying all single products.  *  * @package WordPress  * @subpackage Product_Dir  * @since Product Directory 1.0  */ get_header(); ?-->
<div id="container">
<div id="content">
<!--?php the_post(); ?-->

<!--?php 	$custom = get_post_custom($post--->ID);
	$price = "$". $custom["price"][0];

?>
<div id="post-<?php the_ID(); ?><br />">>
<h1 class="entry-title"><!--?php the_title(); ?--> - <!--?=$price?--></h1>
<div class="entry-meta">
<div class="entry-content">
<div style="width: 30%; float: left;">
			<!--?php the_post_thumbnail( array(100,100) ); ?-->
			<!--?php the_content(); ?--></div>
<div style="width: 10%; float: right;">
			Price
<!--?=$price?--></div>
</div>
</div>
</div>
<!-- #content --></div>
<!-- #container -->

<!--?php get_footer(); ?-->

That’s it!

Well, almost..

One thing is that I have to activate my new child theme.

So, I go to the “Themes” Super Admin menu and enable the Product Directory theme (this step isn’t needed with single-site WordPress).

I then activate the theme in Appearance->Themes (in my case, on the second page).

One thing I’ve learnt the hard way is that the permalink structure may not work if I don’t go and “nudge it.” So I go to the “Permalinks” Settings menu:

And I click on “Save Changes” without changing anything. (I know, it’s counterintuitive. And it’s even possible that it could work without this step. But I spent enough time scratching my head about this one that I find it important.)

Now, I’m done. I can create new product posts by clicking on the “Add New” Products menu.

I can then fill in the product details, using the main WYSIWYG box as a description, the “price” field as a price, the “featured image” as the product image, and a taxonomy as a classification (by clicking “Add new” for any tag I want to add, and choosing a parent for some of them).

Now, in the product management interface (available in Products->Products), I can see the proper columns.

Here’s what the product page looks like:

And I’ve accomplished my mission.

The whole process can be achieved rather quickly, once you know what you’re doing. As I’ve been told (by the ever-so-helpful Justin Tadlock of Theme Hybrid fame, among other things), it’s important to get the data down first. While I agree with the statement and its implications, I needed to understand how to build these things from start to finish.

In fact, getting the data right is made relatively easy by my background as an ethnographer with a strong interest in cognitive anthropology, ethnosemantics, folk taxonomies (aka “folksonomies“), ethnography of communication, and ethnoscience. In other words, “getting the data” is part of my expertise.

The more technical aspects, however, were a bit difficult. I understood most of the principles and I could trace several puzzle pieces, but there’s a fair deal I didn’t know or hadn’t done myself. Putting together bits and pieces from diverse tutorials and posts didn’t work so well because it wasn’t always clear what went where or what had to remain unchanged in the code. I struggled with many details such as the fact that Kyle Jones’s code for custom columns wasn’t working first because it was incorrectly copied, then because I was using it on a post type which was “officially” based on pages (instead of posts). Having forgotten the part about “touching” the Permalinks settings, I was unable to get a satisfying output using Jones’s explanations (the fact that he doesn’t use titles didn’t really help me, in this specific case). So it was much harder for me to figure out how to do this than it now is for me to build content directories.

I still have some technical issues to face. Some which are near essential, such as a way to create archive templates for custom post types. Other issues have to do with features I’d like my content directories to have, such as clearly defined roles (the “More Plugins” support roles, but I still need to find out how to define them in WordPress). Yet other issues are likely to come up as I start building content directories, install them in specific contexts, teach people how to use them, observe how they’re being used and, most importantly, get feedback about their use.

But I’m past a certain point in my self-learning journey. I’ve built my confidence (an important but often dismissed component of gaining expertise and experience). I found proper resources. I understood what components were minimally necessary or required. I succeeded in implementing the system and testing it. And I’ve written enough about the whole process that things are even clearer for me.

And, who knows, I may get feedback, questions, or advice..