Feb 24 2012

HTBDL — 3: Cleaning up the content type

Previously on How to Build a Digital Library: I made a new content type.  Time to clean it up a bit.  I’ll go over the structure with a little more detail later, but right now, I’m more concerned about a little initial organization.  Right now, the Photo Upload content type consists of a list of marginally related fields, but with the help of yet another module, I’m able to group the related fields together in a way that feels natural.

Fieldgroup
I love how straightforward module names are.  You know what you’re going to get before you even install them.  Fieldgroup, unsurprisingly, lets you group fields!  Imagine that.  In Fieldgroup, groups are added to the content type the same way you add fields, then you can click-and-drag fields into the appropriate groups.

For this project, I created 3 groups: Tags, Date, and General Information.  I omitted the first two fields, Title and Image Upload, from the groups, since they stand alone as the required fields for submitting content.  Otherwise, I grouped my fields like so (pics will come soon, I promise):

  • Tags
    • People in this image
    • Places in this image
  • Date
    • Date (exact year known)
    • Date (estimated)
  • General Information
    • Name
    • Location

I am, however, toying with the idea of combining the General Information fields (Name, which identifies the uploader [a sort of provenance for the digital file], and Location, from the Location module that is linked via API to Google Maps) with the two required fields mentioned above, so that the title and upload are encompassed within what is essentially general information about the file.  I’m going to mull that one over for awhile.

Fieldgroup allows you to present groups in a few different ways.  Right now I’m trying out vertical tabs, but this might change.  Again, pics soon.  Promise.

Also updated:
Initially, I had the idea that when tagging the location (through the Places in this location field), the city and state should be kept together as a single term by using a dash in place of the traditional comma, since commas typically denote the separation between intended terms when entering tabs.  I’ve since decided that this is a terrible idea, and that the city name and state (or country) should definitely be separate terms.  I changed the descriptive text in this field to something more appropriate.


Jan 16 2012

How to Build a Digital Library — 2: A new content type is born!

My goal for this project is to create a digital archive for family photos, and having experience with Drupal in the past, I realized that the default content types (in Drupal 7, Article and Basic page) weren’t going to cut it.  For this, I would need something way more customized, so I dove right in and officially started the project by creating a new content type.

Photo Upload

That was the name I gave it.  Not very creative, I’ll admit, but it’ll do for now.  To accomplish this, I:

  1. selected Structure on the Drupal menu,
  2. selected Content types from the submenu,
  3. and clicked the Add content type link that appears above the default selections.
  4. On this page, I entered Photo upload in the required Name field,
  5. left the default Title in the Title field label field,
  6. clicked the Save and add fields button at the bottom of the page,
  7. and started adding fields that I felt would be cool to try out.
 

 

My initial fields:

  • Title — It’s kinda default.  One way or another, uploaded content needs a title, and admittedly, a title if available, is necessary metadata.
  • (Body)  — Just a note here since I actually deleted this field.  For this project, there was no need for it.
  • Image – I think I actually had to activate this in the module menu, but it’s your basic image upload.  This can probably be improved later on with additional modules, but it’s a no-brainer right now.
  • Term Reference (people and places) – I added this field twice for two different sets of information.  I’ve never used this in the past, but it looks like an incredibly easy way of adding tags that are automatically categorized as taxonomy terms.  So looks like I’ll be able to do some cool things using these fields, including allowing people and places featured in the photos to be tagged and sorting photos based on those tags.
  • Date – After activating the Date module, I added a Date field and limited the options to just the year (I felt specific month/day options were not likely to be remembered/recorded, anyway), so that when photos are uploaded and the actual year of the photo is known, it can be noted.
  • List (text) [Date (estimated)] – Next, I added a List (text) field and populated it with a list of decades going back to the 1860s.  The whole point is to allow an estimated date option (identifiable by decade) if the exact date isn’t known.
  • Text (Name) – I added a basic text field so that the uploader can identify themselves.
  • Location – Finally, I activated the Location module and added a Location field so that users can specify an exact location where the photo was taken.  This is similar to the location tagging field mentioned above, but this module actually produces a Google Map links to present the location using, well, Google Maps.  Pretty awesome.

Next: More on content types!

 

 

 

 

 

 


Jan 12 2012

How to Build a Digital Library — 1: We meet again, Drupal

 

Let me preface this by saying: I’m cheating. At least it feels like I’m cheating. You see, I didn’t actually perform the Drupal install myself; instead, I let my web host take care of that. I don’t think this should automatically tarnish my project, but I’m of the mindset that if you want to create something yourself, then you should start completely from scratch. To me, it’s like making a pie with a store-bought crust; sure, you made the pie as a whole, but did you make the crust that keeps it together? No? Too bad. Anything less is cheating. But I suppose pie is pie, and the end result is good no matter what went into it.

Drupal 7

Hey there, smiling Drupal guy.

Now that I’ve got that off my chest, this is how I started. I noticed immediately that I was dealing with Drupal 7, which was a bit mind-blowing considering I was using Drupal 5 (I think) not too long ago. Frankly, I don’t even remember there being a Drupal 6, but I suppose it had to be there. I did a little recon to see what Drupal 7 offered, and I was pleasantly surprised. I had grown accustomed to using the CCK module with the earlier build, and seeing that it was now part of the core was pretty awesome. I knew there were other modules I would need, though, even if I wasn’t sure how to use them yet. The following are the initial modules that I added to the core build.

Meta Tags
First and foremost, I installed Meta Tags (which also required CTools and Token). If I’m building a digital library–a legit digital library–then I would need the ability to manage my metadata using an actual standard, and this seems like it might be a good option.

Dates
I also installed Dates because, honestly, you need to have Dates. A date field would be a vital piece of metadata for a photograph, and I knew that using this module would save me the trouble of making a select list for years associated with an uploaded photograph. So, yeah, Dates.

Location
Finally, I installed Location because it seemed like it might have a lot of cool options for location-based metadata. I don’t really know much about it yet, but it has Google Maps integration, so it could turn about to be a nifty resource.

Next up: Creating a new content type!