Related Stories.

After hacking through the source, I finally figured out how to make {relatedstories} work. The trick is that it stores the date in a variable called $relatedstories.

 1    {relatedstories}
 2    {if $relatedstories}
 3      <h2>Related Stories</h2>
 4      <ul>
 5      {foreach from=$relatedstories key=key item=story}
 6        <li> <a href="{get_permalink id=$story->ID}" >
 7            {$story->post_title}</a>
 8        </li>
 9      {/foreach}
10      </ul>
11    {/if}

I’ve got it set up in my sidebar at the moment. It’s smart enough to figure out when it’s not a single post page, and won’t show then, so you don’t need any fancy extra Smarty Tags to only show in single post view. Oh, and it also sets the variable $relatedstoriesWords, so it’s possible to do something like: <h2 title="{$relatedstoriesWords}">Related Stories</h2> and when you hover over the title, it tells you the words it’s looking for. I’m still working on how to truncate the title. {$story->post_title|truncate} fails dismally. Quite annoying.