Site update : what does what


Recently I've incorporated several new features into the Straight to the Bar site, some of which are listed below. Also noted are a couple of older features that seem to generate a few questions.

Icon beside header line in Workout entries

This little guy performing a deadlift only appears when the post is a workout (as does the kg/lbs line in the individual archives). Both of these features are achieved using the Compare plugin, and the template code :

<MTIfEqual a="[MTEntryCategory]" b="Workouts">

<div class="icon" /><$MTEntryTitle$></div>

</MTIfEqual>

<MTIfNotEqual a="[MTEntryCategory]" b="Workouts">

<h1><$MTEntryTitle$></h1>

</MTIfNotEqual>

and

<MTIfEqual a="[MTEntryCategory]" b="Workouts">

| weights in kg/lbs

</MTIfEqual>

Add to digg, del.icio.us etc

The code for this is actually quite simple (although it took a while to track down) :

add to : <a href="http://del.icio.us/post?url=<$MTEntryPermalink$>&title=
<$MTEntryTitle$>">del.icio.us</a> |

<a href="http://digg.com/submit?phase=2&URL="<$MTEntryPermalink$>"
>digg</a> |

<a href="http://technorati.com/cosmos/search.html?url=
<$MTEntryPermalink$>"
>technorati</a> |

<a href="http://blinklist.com/index.php?Action=Blink/addblink.php
&Description=<$MTEntryTitle$>&URL=<$MTEntryPermalink$>">
blinklist</a> |

<a href="http://furl.net/storeIt.jsp?t=<$MTEntryTitle$>
&u=<$MTEntryPermalink$>"
>furl</a> |

<a href="http://reddit.com/submit?url=<$MTEntryPermalink$>&title=
<$MTEntryTitle$> ">reddit</a>

Pandora

Having recently re-discovered the brilliance that is Pandora, I decided to add a few stations to the sidebar (for those of you curious as to the type of music I train to). It really just depends on mood.

The code for adding a station list to a site, as well as a few other novel uses for Pandora, can be found here.

Fitness and Strongman links

These are now dynamically created, based on the information in the flinks and slinks categories. A separate template has been created for each.

Last Comment

These are now noted on the Individual Archive pages as :

n comments (last by name) for example, 7 comments (last by Bud Gibson)

Also changed in the comments handling is the way my own responses are displayed. These are now clearly differentiated from the rest of the discussion. For more info on this (including how to do it in Movable Type) see this article on Learning Movable Type.

Restriction of entries on the front page

Previously, entries from any category would appear on the front page. In some cases it meant that items I'd prefer to remain hidden (at least from that page) would appear - such as the feedback and thank-you pages.

To get around this, I've altered the code in my Main Index template :

<MTEntries lastn="5" category="workouts OR Diet and Nutrition OR News OR General OR reviews OR exercises OR routines OR Articles">

This will display entries from any of the categories workouts, Diet and Nutrition,News, General, reviews, exercises, routines or Articles.

Latest Entries

Near the bottom of the sidebar is a Latest section, which displays the most recent posts (in the abovelisted categories) to appear on this site. The code is :

<h1>Latest</h1>

<ul>

<MTEntries lastn="7" category="workouts OR Diet and Nutrition OR News OR General OR reviews OR exercises OR routines OR Articles">

<li><a rel="bookmark" title="<$MTEntryTitle remove_html="1"$>" href="<$MTEntryLink$>"><$MTEntryTitle smarty_pants="1"$></a>  |  <$MTEntryDate format="%d %b %y"$><br />
<MTEntryBody words="5"> <a rel="bookmark" title="<$MTEntryTitle remove_html="1"$>" href="<$MTEntryLink$>"><img src="http://www.99shadesofgrey.com/images/arrow_right.gif" align="absbottom"/></a></li>

</MTEntries>

</ul>

Archives in sidebar

Two major changes here. The first is a - when applicable - look at what was happening exactly one year ago. If there were no posts on that day, nothing appears. This information is extracted using the OnThisDay plugin.

This is integrated as follows :

<MTOnThisDay>

   <MTEntries lastn="1" category="workouts OR Diet and Nutrition OR News OR General OR reviews OR exercises OR routines OR Articles">

   <ul>

      <MTDateHeader>

        <li><a rel="bookmark" title="<$MTEntryTitle remove_html="1"$>" href="<$MTEntryLink$>">

          <$MTEntryDate format="%b %e, %Y"$>: <$MTEntryTitle$>

        </a></li>

      </MTDateHeader>

      <div><MTEntryExcerpt words="15"> <a rel="bookmark" title="<$MTEntryTitle remove_html="1"$>" href="<$MTEntryLink$>"><img src="http://www.99shadesofgrey.com/images/arrow_right.gif" align="absbottom"/></div>

   </ul>

   </MTEntries>

</MTOnThisDay>

The second is the appearance of two dropdowns, which offer quick access to both the complete category listing and monthly archive listing for this site. These are generated using a combination of MT, PHP and Javascript; with code courtesy Brad Choate - see his site for more information.

Header Images

These change with each page reload, using Hivelogic's Image Rotator script. The full sized images can be seen here. I first became aware of this script via this article on A List Apart (just after having written my own - tried and tested ultimately won out).

NB : code used in the above samples was automatically cleaned up (for display) using Dan Cederholm's SimpleCode.





Discussion

I'd love to hear what you think. Pop over to the forums and share your opinion. See you there.