PDA

View Full Version : How-To: Link Story Title Directly To Outside Source Link


elderban
03-05-2008, 09:01 PM
I've modified the summary/default.tpl template to have the story title link directly to an outside story instead of having a link to the outside source of the article at the end of the summary. If there's no link to the outside article, then it will link to the article on your site.

It's pretty simple to do. Just go into your template editor, open up summary/default.tpl, and replace ALL of the code in there with the following:

<vte:template>
<div class="short">
<div class="short_holder">
<vte:if test="{article.image}">
<div class="image">
<a href="{article.get_href}"><img src="{VIVVO_URL}thumbnail.php?file={article.get_image}&amp; size=summary_medium" alt="image" /><br /></a>
</div>
</vte:if>
<vte:if test="{article.get_link}">
<h2><a href="{article.get_link}"><vte:value select="{article.get_title}" /></a></h2>
<vte:else>
<h2><a href="{article.get_href}"><vte:value select="{article.get_title}" /></a></h2>
</vte:else>
</vte:if>
<span class="summary"><vte:value select="{article.get_summary}" /></span><vte:if test="{article.body}">...</vte:if>
</div>
</div>
</vte:template>

The only downfall with this is that there's not an option to leave comments to stories that are linked to other sites.

I am, however, working on implementing a link-out script that would show the story with a link back to my site and a link to a page where they can post comments. I will post this modification at a future date.

Note: Be sure to make backups of any templates that you plan to modify BEFORE you modify them!

Additional Note: This only makes modifications to the links on your home page. You'll have to make similar modifications to other pages as well for the effect to be site-wide (it would be nice if you had to only change it in one spot, though...hint, hint)

boccio
03-05-2008, 10:43 PM
Great one, thanks for sharing!

Micha
03-06-2008, 09:24 AM
Nice one :)

You'll have to make similar modifications to other pages as well for the effect to be site-wide (it would be nice if you had to only change it in one spot, though...hint, hint)

This would be very hard due to different summary types.
summary_default.tpl is the most common, and changing it will affect most of the site.