[RSS Aggregator] how to link to original articles from feed?

Creating and modifying plugins.
Post Reply
oliof
Regular
Posts: 9
Joined: Thu May 17, 2007 12:55 pm

[RSS Aggregator] how to link to original articles from feed?

Post by oliof » Wed Jul 29, 2009 2:35 pm

Hi,

after I got my aggregator running smoothly, I want to change another part of my setup: I would like to link to the original article from the RSS Feed, not to my aggregator site.

Since I played with the template a bit to show the original article links on the article list, I know about

Code: Select all

$entry.properties.ep_aggregator_articleurl
. What I would need is pointers how to change the way the RSS feed for the planet is generated (ideally from within the plugin, so the changes are contained and available to people who use the aggregator plugin).

Help, please?

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [RSS Aggregator] how to link to original articles from feed?

Post by garvinhicking » Wed Jul 29, 2009 3:26 pm

Hi!

If you know about the Smarty variable, you simply need to use it in your entries.tpl template instead of {$entry.link} in the places, where you want the original link. :-)

There's no need to do anything in the plugin; in fact, it would be wrong to do anything in the plugin.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

oliof
Regular
Posts: 9
Joined: Thu May 17, 2007 12:55 pm

Re: [RSS Aggregator] how to link to original articles from feed?

Post by oliof » Wed Jul 29, 2009 11:02 pm

entries.tpl is used to generate the RSS feed?

User avatar
Don Chambers
Regular
Posts: 3633
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: [RSS Aggregator] how to link to original articles from feed?

Post by Don Chambers » Wed Jul 29, 2009 11:34 pm

oliof wrote:entries.tpl is used to generate the RSS feed?



No... look in /templates/default for tpls beginning with "feed_", such as feed_2.0.tpl, which is rss2. You can copy these files to your template folder and edit those copies so that your modifications will not be lost with updates to s9y.

BTW - I am leaving unexpectedly for a week, so I will not be able to test your modifications until then.

oliof
Regular
Posts: 9
Joined: Thu May 17, 2007 12:55 pm

Re: [RSS Aggregator] how to link to original articles from feed?

Post by oliof » Thu Jul 30, 2009 10:33 pm

Thanks, Don. I was pretty sure I looked for .tpl files relating to RSS feeds, but it seems I looked in the wrong place. With your hint implementing this change was a matter of minutes.

S9Y rocks!

Xanthouos
Regular
Posts: 115
Joined: Wed Mar 02, 2005 7:59 pm
Contact:

Re: [RSS Aggregator] how to link to original articles from feed?

Post by Xanthouos » Sat Oct 03, 2009 10:30 pm

I know this is an old post, but seems it's the closest to what I need.
I have the RSS Aggregator installed, posting the feeds as posts on the blog. I would like in the postings on my site to link back to the original feed.
I'm not sure if this is what the original post was about. I didn't quite understand the implementation.
Anyway, does it work to link in the post (from the RSS feed), back to the original site where the feed came from?
TIA.
If you can't be a missionary, you can support a missionary.
~~~~~~~~~~~~~~~~~~~~~
www.GetMepis.com

User avatar
Don Chambers
Regular
Posts: 3633
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: [RSS Aggregator] how to link to original articles from feed?

Post by Don Chambers » Sun Oct 04, 2009 2:32 am

Well, yes and no. In the example above, the request was to provide a link to the original article from the rss feed.. not from the site itself.

To do what you are requesting is quite similar. Entries are displayed, in summary and detail, with the smarty file entries.tpl. Your template may have a custom version, but if not, it will use the file from /templates/default/.

Entry titles are often displayed with something like this:

Code: Select all

<h4 class="serendipity_title"><a href="{$entry.link}">{$entry.title}</a></h4>


You could change that to something like this:

Code: Select all

<h4 class="serendipity_title"><a href="{if $entry.properties.ep_aggregator_articleurl}{$entry.properties.ep_aggregator_articleurl}{else}{$entry.link}{/if}"</a></h4>


The above basically says "if this is an aggregated entry, the link to the entry is the original link, but if not, it is my site's regular entry link". Let me know if you require a more detailed explanation or if you can run with it from just this.

Xanthouos
Regular
Posts: 115
Joined: Wed Mar 02, 2005 7:59 pm
Contact:

Re: [RSS Aggregator] how to link to original articles from feed?

Post by Xanthouos » Sun Oct 04, 2009 6:06 pm

Thank you Don, that was a good explanation. It didn't seem to make any difference.
I made the changes in both the template folder and /default
If you can't be a missionary, you can support a missionary.
~~~~~~~~~~~~~~~~~~~~~
www.GetMepis.com

User avatar
Don Chambers
Regular
Posts: 3633
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: [RSS Aggregator] how to link to original articles from feed?

Post by Don Chambers » Mon Oct 05, 2009 3:07 am

Xanthouos wrote:Thank you Don, that was a good explanation. It didn't seem to make any difference.
I made the changes in both the template folder and /default


Maybe I missed something... This weekend has been a PITA... I had to drive nearly 600 miles in the last 2 days just to get my oldest son to a soccer tournament and back TWICE, and I answered your post about halfway through that trip!! :wink:

So, what did or did not work? I might need to see this in action, so send me a link, or contact me via PM if you would like me to take a closer look.

After 600 miles, I now need to relax with a few cold "adult beverages"!! :wink: :wink: :wink:

Xanthouos
Regular
Posts: 115
Joined: Wed Mar 02, 2005 7:59 pm
Contact:

Re: [RSS Aggregator] how to link to original articles from feed?

Post by Xanthouos » Tue Oct 06, 2009 2:17 pm

I'll PM you. Thank you!
If you can't be a missionary, you can support a missionary.
~~~~~~~~~~~~~~~~~~~~~
www.GetMepis.com

Post Reply