Page 1 of 1

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

Posted: Wed Jul 29, 2009 2:35 pm
by oliof
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?

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

Posted: Wed Jul 29, 2009 3:26 pm
by garvinhicking
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

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

Posted: Wed Jul 29, 2009 11:02 pm
by oliof
entries.tpl is used to generate the RSS feed?

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

Posted: Wed Jul 29, 2009 11:34 pm
by Don Chambers
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.

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

Posted: Thu Jul 30, 2009 10:33 pm
by oliof
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!

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

Posted: Sat Oct 03, 2009 10:30 pm
by Xanthouos
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.

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

Posted: Sun Oct 04, 2009 2:32 am
by Don Chambers
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.

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

Posted: Sun Oct 04, 2009 6:06 pm
by Xanthouos
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

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

Posted: Mon Oct 05, 2009 3:07 am
by Don Chambers
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:

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

Posted: Tue Oct 06, 2009 2:17 pm
by Xanthouos
I'll PM you. Thank you!