Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-12-12 13:03:16
- Cairsten
- New Member
- Registered: 2007-12-12
- Posts: 2
showing custom fields and article image in the RSS/Atom feeds?
Hi, folks.
I’m new to TextPattern this week, so please forgive me if this is a stupid or obvious question. I’m setting up a replacement for my LiveJournal, with a feed so that those people who used to read my LiveJournal can still keep reading with almost no effort on their part.
I have wrestled with the theme, a modified version of Maple Leaf. I have figured out how to duplicate LJ’s userpics with article images. I have set up meta data such as LJ’s mood and theme with custom fields. I have even, after much headscratching, klutzed (less than kludged!) a way to show an easily-identifiable “comment here” type link on every one of the multiple articles on the front page and not just when one looks at the articles separately. This I say not to brag, but to promise you that I really and truly have looked at the FAQs and textbook, and I haven’t found what I’m looking for. ;)
I’d like to know, please, if and how I can make the feeds pick up the “userpic” and the meta data as part of the articles themselves. Right now both those things display, but only on the site pages, not in the feed. I could klutz this by manually putting them in the articles when I write them, but if there’s a better way, I’d love a pointer in that direction.
Thanks,
Cairsten.
Offline
Re: showing custom fields and article image in the RSS/Atom feeds?
Well, firstly you don’t need any php-coding-skills to do that. A plugin and some pagetemplate and couple of txp-forms could simply do that.
1. Install and activate plugins mg_setheader and jad_oldposted
2. Create new page-template, like rss with code something similiar to this:
<txp:mg_setheader /><?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<generator>http://textpattern.com/</generator>
<title><txp:sitename /></title>
<link><txp:site_url /></link>
<description><txp:site_slogan /></description>
<copyright>Copyrights (c) <txp:php>echo gmdate( "Y" );</txp:php> <txp:sitename />. All rights reserved.</copyright>
pubDate><txp:php>echo gmdate( "D, d M Y H:i:s T" );</txp:php></pubDate>
<txp:article_custom allowoverride="0" form="rss-item" limit="20" pgonly="0" section="section" sort="Posted desc" />
</channel>
</rss>
3. In article-form rss-item:
<item>
<title><txp:title /></title>
<description><![CDATA[
<txp:article_image />
<txp:body />
<p><txp:keywords /></p>
]]></description>
<link><txp:permlink /></link>
<pubDate><txp:jad_oldposted format="D, d M Y H:i:s" /> GMT</pubDate>
<dc:creator><txp:author /></dc:creator>
<guid><txp:permlink /></guid>
</item>
4. Create new section, like rss-feed and implent it with pagetemplate named rss. You should check all options of this section off. Now it’s done. In yoursite.com/rss-feed/ you have new nice feed layout. Continue styling it, and you would recieve miracles :-)
Cheers!
Last edited by Gocom (2007-12-12 13:37:56)
Offline
Re: showing custom fields and article image in the RSS/Atom feeds?
Check out this thread lots of info on doing this and at least one plugin to help you out.
Shoving is the answer – pusher robot
Offline
#4 2007-12-13 00:06:01
- Cairsten
- New Member
- Registered: 2007-12-12
- Posts: 2
Re: showing custom fields and article image in the RSS/Atom feeds?
That plugin works beautifully, thank you. Thank you to both of you for the pointers in the right direction.
Cairsten.
Offline
#5 2011-08-11 13:13:49
- pafruu
- Member
- From: New Brunswick, Canada
- Registered: 2010-01-14
- Posts: 65
Re: showing custom fields and article image in the RSS/Atom feeds?
Hello I found this post very interesting and I used it. However, it is not working for me. I would like the rss to display the new articles in the news and nouvelles section of my website.
Entering just the codes and following the steps didnt do it for me. I am missing something but I am not sure what exactly.
I need help with this. I m very new to setting an rss feed on a website. Please be gentle :)
I try, and I try, and I try…. and sometimes I achieve
Offline
Re: showing custom fields and article image in the RSS/Atom feeds?
Hi Patrick,
the rss is populated by the 10 newest articles allocated to sections which have rss enabled. To check which sections are syndicated go to presentation>sections and enable the syndication for the ones you wish to have feeds.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#7 2011-08-11 15:48:34
- pafruu
- Member
- From: New Brunswick, Canada
- Registered: 2010-01-14
- Posts: 65
Re: showing custom fields and article image in the RSS/Atom feeds?
Thanks for your reply,
I checked my sections and almost all of them are syndication active. I s there something else That I have to do?
I try, and I try, and I try…. and sometimes I achieve
Offline
Re: showing custom fields and article image in the RSS/Atom feeds?
If you edited out the code from the <head>
in your templates, just add
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
That’s it:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#9 2011-08-11 19:24:56
- pafruu
- Member
- From: New Brunswick, Canada
- Registered: 2010-01-14
- Posts: 65
Re: showing custom fields and article image in the RSS/Atom feeds?
do you mean like this:
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
<title>Town of Rogersville</title>
<link rel=“stylesheet” href=”<txp:site_url />css/styles.css” type=“text/css” />
<link rel=“stylesheet” href=”<txp:site_url />css/slimbox.css” type=“text/css” />
<link rel=“stylesheet” href=”<txp:site_url />css/slides.css” type=“text/css” />
<script type=“text/javascript” language=“javascript” src=”<txp:site_url />js/functions.js”></script>
<script type=“text/javascript” src=”<txp:site_url />/js/mootools.js”></script>
<script type=“text/javascript” src=”<txp:site_url />/js/slimbox.js”></script>
<txp:feed_link flavor=“atom” format=“link” label=“Atom” />
<txp:feed_link flavor=“rss” format=“link” label=“RSS” />
</head>
I try, and I try, and I try…. and sometimes I achieve
Offline
Re: showing custom fields and article image in the RSS/Atom feeds?
pafruu wrote:
do you mean like this:
Yes. Looks good:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#11 2011-08-12 13:21:16
- pafruu
- Member
- From: New Brunswick, Canada
- Registered: 2010-01-14
- Posts: 65
Re: showing custom fields and article image in the RSS/Atom feeds?
ok I’ve put it on my template.
The next question might sound stupid but here it is,
in the <txp:article_custom> declaration on the rss page template, do I have to specify the sections that I want the feeds to be taken from or leave it at section=“section” ?
I try, and I try, and I try…. and sometimes I achieve
Offline
#12 2011-08-13 13:16:29
- pafruu
- Member
- From: New Brunswick, Canada
- Registered: 2010-01-14
- Posts: 65
Re: showing custom fields and article image in the RSS/Atom feeds?
I must be doing something wrong because it is still not working, but I did follow every step of the way. I do not know why it is not working. I need help
I try, and I try, and I try…. and sometimes I achieve
Offline