Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[request] Article Image as Feed
I’m currently reworking my website as a textpattern driven photoblog and would like to have textpattern automatically use the article image for my feed. I found some helpful notes here: http://textsnippets.com/posts/show/332 – but the code for feeds in 4.0.4 must be different than the 4.0.2 version the snippets were for.
I read that you could change the feed output in 4.0.4 via a plugin and was hoping someone could take some time and help me out with this one.
Thanks!
“I was born to hustle roses down the avenues of the dead.” – Charles Bukowski
The Human Museum
Offline
Re: [request] Article Image as Feed
I’d like to second this request. This would really help a lot. Thanks!
Offline
Re: [request] Article Image as Feed
Zem had a little write up on the new 4.0.4 XML Feed Callbacks. On the surface this seems like it would be fairly easy to accomplish.
Shoving is the answer – pusher robot
Offline
Re: [request] Article Image as Feed
I use this addition to rss.php at like 72:
if (!empty($thisarticle['article_image']) {
$images = explode(',' , $thisarticle['article_image']);
$content .= '<img src="/images/'.$images[0].'.jpg" />';
}
You can trim that down if you don’t use multiple images. Also change “$content .=” to “$content =” if you want to just show the image (and not body/except text). But yeah, the XML Callback seems like the best way to go…
Last edited by Jeff_K (2007-02-17 20:04:18)
Offline
#5 2007-03-01 05:01:04
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: [request] Article Image as Feed
…use the article image for my feed…
You mean, just include your article image in your feed’s content?
Offline
Re: [request] Article Image as Feed
Hi Mary – yep, that’s exactly what I want to do (and I suspect that’s what Paul wants too). I’m taking Jeff’s hack for a spin, but this does seem ripe for a plugin.
- Jason
Offline
#7 2007-05-02 17:00:49
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: [request] Article Image as Feed
Mary schrieb:
You mean, just include your article image in your feed’s content?
Yep, … any plugin out for that already?
Offline
#8 2007-05-02 18:08:26
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: [request] Article Image as Feed
I don’t think there is one. If someone can verify that, I can certainly work on one.
Offline
Re: [request] Article Image as Feed
I’ve searched for one, but does’nt found any Plugin, would be great to have :)
Your code works, but isnt that perfect. I think the Image-Id musst be parsed by Textile, because we only have the ID, what if the Image isn’t a JPEG? Or what if we want a thumbnail to show in the feed?
I think it would be great, if there was a plugin that can modify the output of feed-data with a little magic of textile…
Last edited by grafzahl (2007-05-02 20:06:47)
Offline
Re: [request] Article Image as Feed
The ideal thing would be to insert the result of one of the many article-image plugins out there into the feed. There is a fair amount of logic that goes into displaying the article-image, they can also not be explicit URLs not just ids, not to mention the thumbnail question.
Maybe something that appended the output of a form to the feed would be the ideal situation, that way you can leverage existing work.
Shoving is the answer – pusher robot
Offline
Re: [request] Article Image as Feed
Warning: Barely tested
hak_feed_append will append the contents of a form called feed_append to the body of a feed.
Known Issues:- You have to create the form
- nothing happens for summaries
- Barely tested.
Please report issues, ideas. I threw this together in 5 minutes. If it works I’ll create thread over in Author Support.
Or I don’t know what do you think is better Mary? I can post something over there now but this is pretty rough.
Last edited by hakjoon (2007-05-02 22:01:57)
Shoving is the answer – pusher robot
Offline
Re: [request] Article Image as Feed
Hi hakjoon,
i think it would be great if the user could customize the howl body-content of the feed.
So, i would include <txp:body /> to feed_append and it would look like the original feed, but if i would put in <txp:article_image thumbnail=“1” /><txp:body /> it would include the article-image before the body-content.
I think this is more flexibel then only to append the form at the end of the feed-body.
Update: Ok, ive just edited line $thisarticle[‘body’] .= parse($form); to $thisarticle[‘body’] = parse($form); and can now fully edit the body-content of my feed-output, just include <txp:body /> to the form feed_append to get the original result, works great! great and simple…
Last edited by grafzahl (2007-05-03 12:34:23)
Offline