Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-05-01 11:58:49

biggles
Member
Registered: 2007-10-11
Posts: 24

RSS tag filter

Hi folks,

How do I discover what the RSS feed is for any story marked with a particular tag. If for example, I have a tag called ‘me’, how do I find the RSS feed for only stories on my blog with that tag?

(At the moment, I’m using technorati tags, something I’m planning on changing soon. I guess I just need to make tags plain hash whatever (ie #whatever) or just text?)

Does Textpattern have the equivalent of the Wordpress “http://ttwexample.wordpress.com/tag/teachtheweb/feed” as a feed URL?

Many thanks!

Offline

#2 2013-05-01 14:21:18

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: RSS tag filter

biggles wrote:

Does Textpattern have the equivalent of the Wordpress “http://ttwexample.wordpress.com/tag/teachtheweb/feed” as a feed URL?

Filtering by keywords is not supported. You can only filter the built in feeds using sections and categories, by using section and category HTTP query params.

Offline

#3 2013-05-01 15:52:37

biggles
Member
Registered: 2007-10-11
Posts: 24

Re: RSS tag filter

Hi Gocom,

Thanks for the swift response. The particular stories I mentioned do have a section (my blog) and more importantly a category.

How could I supply someone a feed URL for a particular category?

Thanks.

Offline

#4 2013-05-01 16:18:54

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: RSS tag filter

Hi
you can use <txp:link_feed_link flavor="rss" label="your label" category="your_category" />

All in the textbook


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2013-05-01 19:00:08

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: RSS tag filter

Gocom a écrit:

Filtering by keywords is not supported.

Jukka, I’m surprised that you didn’t mention rah_external_output :)
Because thanks to your plugin, yes, it’s possible :

Basis:

  1. Install rah_external_output
  2. Create a new form and name it rah_eo_tagfeed.
  3. For example (this is an RDF feed) paste, fill in the blanks and tune:
; Content-type: text/xml
<?xml version="1.0" encoding="utf-8"?>
<txp:php>global $variable; $variable['tag'] = gps('tag');</txp:php>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <generator>http://textpattern.com/</generator>
  <title><txp:site_name /></title>
  <description> ... </description>
  <link><txp:site_url /></link>
  <atom:link href="<txp:site_url />?rah_external_output=tagfeed&amp;tag=<txp:variable name="tag" />" rel="self" type="application/rss+xml" />
  <pubDate><txp:php>echo safe_strftime('rfc822');</txp:php></pubDate>
  <txp:article_custom limit="100" break="">
  <txp:if_keywords keywords='<txp:variable name="tag" />'>
    <txp:variable name="item_content" value='<![CDATA[<txp:body />]]>' />
    <item>
      <title><txp:title no_widow="0" /></title>
      <link><txp:permlink /></link>
      <guid><txp:permlink /></guid>
      <pubDate><txp:posted format="rfc822" /></pubDate>
      <description><txp:variable name="item_content" /></description>
      <content:encoded><txp:variable name="item_content" /></content:encoded>
      <dc:creator><txp:author /></dc:creator>
    </item>
  </txp:if_keywords>
  </txp:article_custom>
 </channel>
</rss>

The feed’s URL is http://www.example.com/?rah_external_output=tagfeed&tag=thetag

Refinement:

Add this rule to your .htaccess:

	RewriteRule ^tag\/(.*)\/feed$ /?rah_external_output=tagfeed&tag=$1 [R=301,L]

The feed’s URL is now: http://www.example.com/tag/thetag/feed

Last edited by CeBe (2013-05-04 07:50:57)

Offline

#6 2013-05-02 08:20:04

biggles
Member
Registered: 2007-10-11
Posts: 24

Re: RSS tag filter

Hi Yiannis and Claire,

Many thanks for your help – I will try your suggestions and report back!

Offline

#7 2013-05-08 13:30:03

biggles
Member
Registered: 2007-10-11
Posts: 24

Re: RSS tag filter

Hi Yiannis,

I tried your suggestion (I want to try a simple solution before trying Claire’s idea) and it unfortunately it failed. However, it’s probably because I’m doing it wrong! I created a tag called mylabel with this code:-

<txp:link_feed_link flavor="rss" label="mylabel" category="my-label" /> 

And I put it in my blog post, based on an Article category I created called My Label (which gets converted to my-label for the HTML).

It generated this feed code:-

http://www.mysite.com/index.php?rss=1&amp;area=link&amp;category=my-label

but this gives me “The feed being requested cannot be found.” in Google Reader and the title of this feed is (title unknown).

What am I doing wrong? I just want to be able to send a feed to someone that will only see articles with the tag mylabel.

Thanks!

Offline

#8 2013-05-08 16:09:54

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,310

Re: RSS tag filter

Hm, is it because of link_feed_link instead of feed_link?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#9 2013-05-09 11:19:29

biggles
Member
Registered: 2007-10-11
Posts: 24

Re: RSS tag filter

Hi Uli,

You’re right! I changed it to:-

<txp:feed_link flavor="rss" label="mylabel" category="my-label" />

It works perfectly now!

Many thanks for the advice and your swift response!

Offline

#10 2013-05-09 11:33:01

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: RSS tag filter

Oops that was my bad. Apologies.


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 2013-05-09 11:40:09

biggles
Member
Registered: 2007-10-11
Posts: 24

Re: RSS tag filter

Hi Yiannis,

You’re forgiven!!

:)

Offline

Board footer

Powered by FluxBB