Blog Pile, Wordpress

WordPress Dissected: The Blogless Blog

It’s been a while but it is time to add to my collection of WordPress Dissected where I break down web sites I have been building using WordPress but with some moderate to severe template wrangling.

Today I present an NMC project set that is sort of a Zen Riddle. If a blog has no posts is it a web site? This is the editing area for a finished web site:

marcus-no-posts

How? Why?

The web site is made up entirely of WordPress pages, because there is nothing chronological in the site’s structure (though if we ever added a news section it would be easy). There was a reason I organized it around Pages… and I cannot remember why, but had something to do with being able to list the pages in a sidebar. I think. To be honest, the work started more than a year ago and the site sat behind a password until the grant funders for the project where ready to go public.

The site is for the Edward and Betty Marcus Digital Education Project for Texas Art Museums, a project where we worked with 28 art museum or art education programs in Texas to help them apply storytelling concepts to their collections and artists, and use the Pachyderm software to create online exhibits.

marcus-site

screenshot The overall template design has morphed quite a bit. I knew form the beginning it was going to need a basic 3 column layout, and somehow ended up with Talian which actually does not now look like the first version I had… and beyond the cosmetic changes I ended up doing a lot of cleanup and fixes for the CSS.

There was an intermediate version (now lost) that had a pink and green theme, even an animated Flash Texas map– a mock layout is what found and the now unused map that wa supposed to be a splash intro:

layout test 2

texas

Soon before we went public, we got a hint that they wanted something less cartoonish and simpler, so we went to the more Texas color theme of the final site.

That’s just the cosmetics. Time to go under the hood and bang the pipes.

The bulk of the site are different WordPress Pages for each museum, such as the Blanton Museum of Art:

marcus-blanton

The left sidebar on all site pages is the same- some static top links, and using the command to list all the museum pages by excluding all the other pages

The main column content is written for each museum, with some standard headings. The project screen shots are linked to the museum’s Pachyderm Projects- which show a lot of evolution in the two years of the projects, as the Matto example from the Blanton demonstrates nicely.

At the bottom, in homage to the lost map, I have embedded Google MyMaps with locations for each museum, so if you are on the page for the Old Jail Art Center, there is a “Where in Texas is the Old Jail Art Center”

marcus-map-old-jail

and the main web page has a full map with all the museums located.

All the magic happens on the right sidebar. All of the Museum pages use a special page-museum.php template which just simply has it use a pecial sidebar template rather than the one used on the front page.

I am using some custom queries, external include files, and plugins to pull in museum specific content on the right sidebar. A lazy way would have been to use a separate template for each museum, but I was able to do it from a single sidebar template, using as a reference the database ID for the page.

The first section, Explore Projects, presents an abstract of all the museum’s projects, which can be anywhere from one to four like the Art House at Jones Center. The content in the box is pulled from an external content file in the template/projects subdirectory. The files are named based on the database ID for the page, like 3.php, 22.php etc. This makes it generic for the template to pull in the correct content.

We first jimmy through another iteration of the Loop to grab the ID of the current page

On a single Page, there is only one “post” and from that we get the ID. Then we simply call an include PHP statement to insert the content of that file:

I created these content files as structured PHP statements, so our staff person creating content only had to define content for variables:

There is first some variables that provide the info for the museum:

The next part handles two ways this content is used- if called from a projects-page template we display the name of the museum as a header. But, as we show below, this same content can be called for the front page as a random museum highlighted, so we need to be able to echo different text if the current page template indicates it is a general page:

Finaly, we create a block like this for each project to be listed for a museum, so if there are 4 projects for the page associated with page ID 14, then file 14.php would need four copies of this block of code. The image file is for the square icon stored in the template directory

The next section lists recent comments that have been made only for a particiular museum– to get this to work, I use a function that was built into this template (I think it was, or I put it in there) that allows me to pull an abstact of a comment made specific to a page. I’m able to specify character limits for te comments title, author, format the date string, and most importantly, provide a post ID to limit it to pull comments just to this one page.

That’s all there is (hah) to a museum page.

I also created a single page that lists all projects in one display
, and this does so by simply inserting all of the include files described above used for the side bar. This page uses a special page-projects,php template, which instead of using the content entered for the page in the editor, just pulls it from the external files:

First we simply walk the directory that contains all of the page sidebar content files to build a list of all files, and then sort the file names:

Now that we have all the file names in an array, we simply walk the array and include the files as indicated.

And that’s it- a blog with no blog posts (does it make a sound?)

The next thing I am adding is a gallery page that will have icons for all projects that we can present as a way to explore all the projects in one page, maybe with some CoolIris action.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *