Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-06-13 12:52:30

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,484
Bitbucket GitHub

Generating Atom feed elements - <id> and <updated>

For reasons which are far too inane to go into, I need to code the XML for a valid Atom feed on TXP 4.4.0. I have successfully made the page (which validates) and now I’m working on the article form. I am getting stuck on elements: <updated> and <id>.

The <updated> element is, as you might have gathered, the time when the article was updated (not published – that’s handled by <published>). The default Atom TXP feed includes a valid <updated> element, so there’s definitely a way to extract the information…I’m just at a loss to get my head around how this might be done. Any ideas? Would smd_query be able to do it?

Secondly, I’m trying to generate a UUID for the <id> element. Current thoughts are to hash the article ID and <txp:posted /> epoch timestamp and finagle that into the correct format. The <id> element doesn’t seem to be vital for validation, but for my own warped reasons I’d really like to figure out a way to do this sensibly.

Thank you in advance.

Last edited by gaekwad (2011-06-13 12:53:16)

Offline

#2 2011-06-13 12:58:56

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

Re: Generating Atom feed elements - <id> and <updated>

gaekwad wrote:

the time when the article was updated

Does txp:modified get you close?

Your UUID mechanism sounds logical to me.


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 2011-06-13 13:15:07

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,484
Bitbucket GitHub

Re: Generating Atom feed elements - <id> and <updated>

Bloke wrote:

Does txp:modified get you close?

Perfect! I know it existed somewhere :)

Your UUID mechanism sounds logical to me.

Excellent. Thank you.

Offline

Board footer

Powered by FluxBB