NewsFeaturesDownloadsDevelopmentSupportAbout Us

Plugin related

From LifeType Wiki


Name: Related Posts

Download link: http://sourceforge.net/projects/lifetype/files/

License: GPL

Author: Paul Westbrook

Description

This plugin generates a list of related articles for each post.

Configuration

The plugin configuration page can be found under Control Center->Appearance Management.

Enable your Related Posts plugin in your LifeType control center.

Add the following to your post.template or postandcomments.template:

{if $related && $related->isEnabled() }
  {assign var=postid value=$post->getId()}
  {assign var=recentsrelatedposts value=$related->relatedArticles($postid)}
  {if count($recentsrelatedposts) > 0 }
    {$locale->tr("related_plugin_display")}:
    <ul>
      {foreach from=$recentsrelatedposts item=relatedpost}
        <li>
          <a title="{$locale->tr("permalink_title")}: {$relatedpost->getTopic()}" href="{$url->postLink($relatedpost)}">
            {$relatedpost->getTopic()}
          </a>
        </li>
      {/foreach}
    </ul>
  {/if}
{/if}

Notes

The Related Post plugin saves caches the list of related articles in tmp/related/<articleId>

TODO :

Generate the keywords from the body of the post, instead of just the title.