Thursday, August 27, 2009

Daily Views Lesson

Today while theming Views, I came across a View that was displaying bizarrely. Basically, our Book Clubs block display showed multiple instances of the same entries. It was the only display that did this, all the other block views filtered by taxonomy term and worked fine.

Connor, our intern, observed that the default Fields for the View included 'taxonomy: term', which in turn showed up in the book clubs block, even though we weren't using that field for that block. I removed the 'taxonomy: term' Field from the Book Clubs Block display and the problem went away.

The moral of this story: For each View display, use ONLY the necessary elements for the query. Don't leave Fields, Filters, etc in the display that aren't being used.

Adjusti-Search Module

Our genius intern, Connor Kelly, developed a solution for the search mechanism on new ppld.org. Basically, he constructed a module that allows users to search either the website, The Catalog, the Events Calendar, or anything else, using a pulldown menu. What's more, he submitted this solution to Drupal.org as a contributed module, called Adjusti-Search.

If you are in the market for a Drupal search mechanism that lets you search more than one website using the same Search bar, check it out!

Wednesday, August 12, 2009

My First Themed View!

Success! I just themed my first Views using customized tpl.php files. It was a very simple customization, but still, it's good to get something right on the first try.

Here's how to do it:

  1. In Views, edit the specific View display you would like to theme.

  2. Click on the theme link in Basic Settings. Mine said "Information".

  3. Pick the specific aspect of the theme you'd like to theme. In my case it was "Display Output".

  4. The tpl.php that is being used is in bold. Open that file with an editor (my file was located in Views/themes).

  5. Save the file in your theme directory, renaming it to the most specific name option in the theming information list. In my case, the file being used was views-view.tpl.php, which I renamed to views-view--press-releases--page-2.tpl.php and saved in my theme directory.

  6. Make the changes you need in the new file and save.

  7. Click the "Rescan Template Files" button at the bottom of the View theming information area.

Tuesday, August 11, 2009

Feeding the Brain Rot

I don't know if I've mentioned the problems we've had with pulling in feeds from our Events Calendar, run by Evanced. If not, let's just say that both Aggregator module and the far more robust and complicated FeedAPI module didn't do what we wanted, which was order the events by most recent date first (FeedAPI had further formatting issues I don't want to go into). I had made over 45 feeds in Aggregator before I realized this problem.

Luckily Connor, my rockin' intern, developed a php template I could use to embed feeds into Pages. It's simple to use and does everything I need.

Unluckily, I had to remake and relink ALL the feeds, which rivaled Subject Guides in its tediumality, extreme pain in the arsetitude, and time-consumingness. Great words, I know, but I have brain rot right now, so I'm sticking with them.

Connor is currently researching how to contribute this handy tool as a Drupal module...

Tuesday, August 4, 2009

Subject Guides: The FINAL Final Confrontation

Finally, with the help of my coworker Cheryl, I figured out the answer to the Subject Guide problems, including the placement of tabbed menu. We created a new region called "content-tabs" and placed it between the header and the main content area in page.tpl.php. Then I put all my tabbed menus there. They now appear between the title and the body in each page, including Views! Why didn't I think of that before??

Of course, as a result I had to redo all my work... again. This is the LAST time I'm going to do this. It seriously took all day to reassign the links, menus, blocks, and remove the pages and views.

However, I hope this will solve the jQuery error I was getting in Firefox (see previous post).

Other accomplishments since I last wrote:

  • PPLD Downloads page. Talk about pulling teeth with staff on this one

  • Library Cards. Pending staff approval

  • Board of Trustees

  • Job Help

  • Printer-friendly style sheet



Next up:

  • Train my intern to work with Drupal. He's very bright, so I don't see any trouble, except for time expenditure

  • PPLD Newsroom

  • Upgrade Kiosk

  • Any changes to Library Card pages

  • General formatting of existing pages