Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Yesterday 15:29:18

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 189
Website

Confused about rss feed links

With the weather getting colder, I had this dream last night where my site’s Textpattern pages were warm and comfy, but the other pages were cold and needed to be warmed up somehow. Being a dream, I have no idea what those other pages were; everything is Textpattern.

Anyhoo, I have no idea how rss or atom really work or how they are intended to be implemented. What I want is to have a single, site-wide rss feed. I have a suspicion that this may not be what I have, since I see feed readers hitting every rss link on the site.

The header on every page is generic from the template:

<txp:feed_link flavor="rss" format="link" label="RSS" />

Generating, for example:

<link rel="alternate" type="application/rss+xml" title="RSS feed" href="/rss/?section=contact" />

I also have live links on every web page footer:

  <txp:feed_link trim="<a" replace='<a rel="nofollow"' flavor="rss" class="feed-rss">
    <img src="<txp:site_url />svg/rss.svg" alt="RSS Feed" width="16" height="16" />
  </txp:feed_link>

Generating, for example:

  <a rel="nofollow" type="application/rss+xml" title="RSS feed" href="/rss/?section=contact">
    <img src="/svg/rss.svg" alt="RSS Feed" width="16" height="16" />

So, do I have a single feed for the entire site, or do I have lots of little feeds for each section, category, and article? The feed_link documentation has an example site-wide link:

<txp:feed_link section="" category="" />

Do I want to be doing this (this being empty section & category) in both the headers and footers for every web page?

Last edited by skewray (Yesterday 19:58:47)

Offline

#2 Yesterday 16:56:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,425
Website GitHub

Re: Confused about rss feed links

I believe if you omit the section name from the tag, then it defaults to providing a feed of the latest N articles in that section. The same result will occur if you specify an individual section name in the feed tag.

With an empty section attribute, or if the tag appears on the homepage, my understanding is that it will syndicate all articles from sections that have the syndicate flag set. And the format and quantity can be controlled by a combination of tag attributes and feed preferences.

Feeds are not something I use a lot, so my recollection may be hazy. Happy to be corrected by anyone who knows more.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 Yesterday 16:58:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,425
Website GitHub

Re: Confused about rss feed links

Also, I suspect you should not need to specify the feed in more than one place on a single page. I think readers will take the first instance and apply it. Not entirely sure which takes precedence.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 Yesterday 17:46:51

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 189
Website

Re: Confused about rss feed links

Bloke wrote #338046:

Also, I suspect you should not need to specify the feed in more than one place on a single page. I think readers will take the first instance and apply it. Not entirely sure which takes precedence.

One is visible (footer) while the other is hidden in <head>. Given that I’ve got no clue how people add sites to their readers, I did both.

Offline

#5 Yesterday 17:54:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,425
Website GitHub

Re: Confused about rss feed links

skewray wrote #338047:

One is visible (footer) while the other is hidden in <head>. Given that I’ve got no clue how people add sites to their readers, I did both.

Ah okay. The one in the head will (should) be syndicated by the browser. You might see the feed icon in the URL bar or something which people can click to get the feed URL. Not sure how the icon shows up in recent builds.

The link in the footer should be the fallback, manual method for those who want to copy n paste the link to their feed readers or who click and see the excerpted article feeds in the browser.

Again, that’s from memory, so it seems you are using it as expected.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 Yesterday 23:07:08

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,145
Website

Re: Confused about rss feed links

Bloke wrote #338048:

Ah okay. The one in the head will (should) be syndicated by the browser. You might see the feed icon in the URL bar or something which people can click to get the feed URL. Not sure how the icon shows up in recent builds.

The link in the footer should be the fallback, manual method for those who want to copy n paste the link to their feed readers or who click and see the excerpted article feeds in the browser.

Again, that’s from memory, so it seems you are using it as expected.

Sad state of affairs, edition 3.987,9. Most browsers do not show anything in the UI for feeds anymore. You need a browser extension for that, or your feed reader of choice will eventually add one to your default browser toolbar. Unless you provide a visible link in the <body /> of the page, the visitor has no clue about the existence of a feed (he or she can try asking the feed reader, I am not sure how well that works though).

For a sitewide feed link, something like this works in the <head />:

<txp:feed_link flavor="atom" format="link" label="Atom feed" section="section_name,section2_name" category="" />

or an empty section="" attribute to include all sections of the site. For a feed link in the body, basically the same syntax, but omit the format attribute (docs page).


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB