Happy Valley Heroes

Not resting on my laurels, I present the latest addition to my blogging empire.

Happy Valley Heroes – a site dedicated to athletic accomplishments of past and present Nittany Lion athletes, teams, alumni, and coaches.

I’m still tweaking this somewhat but I consider it at least ready for a public beta. I use each one of these sites as a learning opportunity to pick up a few more skills. With this one, I easily got further down into the site and template code than I ever have before. I had to do a fair amount of tweaking to get the site navigation as dynamic as it is. For someone that basically knows very little about php coding, I’m pretty proud of the way things have worked out.

I still need to add more content before I’ll be happy enough for a total public release. I want to make sure that there’s at least something there for every PSU sport so I’m going to go back through the season for each of them and pull out a highlight or two.

7 Replies to “Happy Valley Heroes”

  1. Only time for a quick peek tonight, but it looks really nice. Pretty sophisticated for a blog. I’ll try to keep looking in.

  2. As usual a good portion of the work is done by the template designer. The latest rage for WordPress templates is what they call magazine style where you have featured articles that appear more prominently in the blog than normal posts. Magazine styles usually work well if you are going to have at least one photo with most of your posts. Since every post in my blog is going to be about a person or a team, I should be able to find a photo to go with every one so I figured a magazine style would work well – and I think it does.

    The designer of this template gave a pretty slick look to it that’s fairly easy to control. Controlling where a post appears is simply done through categories. Put a post in the Headline category and it pops up front and center, posts in the Feature category appear in the top right sidebar. The latest two non-feature, non-headline posts appear in the blog part itself.

    The author also uses some open source code call timthumb that controls the image sizes to make sure that post photos are the correct size for where they appear on the site (the code does do some autocropping that can cause issues so you do have to be somewhat careful on some of your image selections – that’s why the tops of the heads of some of my features are chopped off).

    At first glance my site looks almost exactly like his template stuff but I’ve added some fairly sophisticated and flexible navigation that’s not part of his original design.

    The site design basically called for using only seven categories. The aforementioned Headline and Featured, along with five of your choice that would appear in the category bar running through the center of the bar. I tend to make a lot greater use of categories in my blogs (witness the huge list in this blog).

    I solved the problem by semi-dynamically generating pages that appear in the black bar at the top of the blog. WordPress pages are normally static content that remains constant with the blog. In the Legends blog, they are the “Home” “About Us” “Welcome” and “Archive” pages listed at the top right in the Header.

    I did two things with Pages in Heroes that were not part of the original template design. I used a technique called suckerfish menus (think remoras and sharks and you’ll know why they are called suckerfish menus) so that I could have display more pages than the eight or so that would fit in the original template.

    The second, and slickest, thing was to dynamically generate the content for the page. I used a WordPress feature called Custom Fields as the basis for my dynamic content.

    The next time that you make a post look at the advanced features below the input field. You’ll see that there’s an advanced feature called custom fields where you can define a key and a value for every post or page that you write. My menu system is designed to exploit that.

    Probably the best way to get a feel for how it would work would be to describe how I would have used it if I had designed the Legends blog using it. First, we wouldn’t have the huge list of categories that we do. I would have told people to use keys and values instead (this might have been a hard concept to grasp though and it’s just as well that I didn’t implement the feature when I designed this blog). Logical keys to implement in this blog might be “Who”, “What”, “When”, “Where”. The after writing a post you’d go to the custom field and select the key “Who” and put the persons name as the value. Similarly for “What” you might put in “music”, or “penn state”, or “baseball” as values. The “Where” keys could be values of State College, Chicago, New Jersey, etc. That should give you the idea.

    Here’s how I used it in my blog. Let’s look at a real example. The current first post, not counting the Feature and Headline ones, is about Toyin Augustus running the hurdles in the Olympics for Nigeria. I have assigned a bunch of keys and values to that post. Specifically, they are (displayed in the form of Key = Value):

    Gender = Female

    Name = Toyin Augustus
    Olympic = athlete
    OlympicSport = Track
    OlympicCountry = Nigeria
    Sport = Track(W)

    Basically, I have defined what buckets I want my post to appear in.

    Now I created Pages that will be part of navigation system that appears in my suckerfish menus at the top. The Title of the Page is what I want to appear in the block. The content of the page starts out as blank but there are tags and software code attached to the page that will be used to generate what appears in the page.

    The first piece of code simply says “if you’re not a bottom child page in this hierarchy just display links to all the children pages below you”. The second piece of code says “if you are a bottom child page, lookup the key tag and value tag for this page and go find all the posts that match”.

    So after writing my Toyin Augustus post, I created a Nigeria Page. In tha page, I titled it as “Nigeria”, attached it to the “By Country” page as a child, said it had a tag key of “OlympicCountry” and a tag value of “Nigeria”, all of which takes less than a minute and my work was done. I now have a block called Nigeria that appears when the “By Country” link is rolled over and which will display all posts labeled OlympicCountry=Nigeria when selected.

    My Toyin Augustus post also automatically appears in other Pages that I have already created, specifically Athletes/Female (Key = Gender, Value = Female), Olympian/Athlete (Key = Olympian, Value = Athlete), Olympian/By Sport/Track and Field (Key = OlympicSport), Value = Track), Sport/Women/Track and Field (Key = Sport, Value = Track(W)).

    The dynamically driven menus give me TONS of flexibility in setting up navigation through the blog. That’s one thing in particular that will make it seem more like a normal website.

    Pretty long winded comment but I hope you get the idea.

  3. Gar – better than “trying to keep looking in”, click on the “Subscribe by email” link in the upper right (something that also isn’t part of the original template AND probably something that might be worth adding to this blog too) and you will have an email sitting in your in-basket every morning with my posts of the previous day – it will be just like your own personal Penn State newspaper that you can peruse over coffee. 🙂

  4. Just one – and only on days that I actually post something which will definitely not be everyday because I only will put something up there when it’s truly noteworthy.

    I should clarify that. The email would only include posts from the Heroes site. It’s not an all inclusive email from all my blogs.

  5. New feature – click on Archive in the bar at the top of the Heroes blog. Kind of a different way of showing your archived posts – works well with blogs that usually have a photo with each post.

Comments are closed.