rss xml generator using sitemap help

Permalink 1 user found helpful
Hi all, really appreciate any help anyone can give on this.

So I wanted to create my own job which would create a xml document. I needed to create an RSS feed which would only be updated at a specific time. So it's working well, I cobbled something together by taking the 'generate sitemap' job and hacking it about to create my 'generate newsletter' job.

So far so good, however I lack the knowledge in how I can change the order of the items generated.

I'd really like the generated list to be in date order with the most recent first.

Any help would be hugely appreciated as I'm really stuck.

I've attached my beautiful freak of a piece of code generate_postlist.php
This needs to be added to the folder
/application/jobs

You also need to make sure the following is included in the file
/application/config/app.php
return [
    'newsletter_xml' => [
        'file' => 'newsletter.xml',
        'frequency' => 'weekly',
        'priority' => 0.5,
    ],
];
.

And also add the thumbnail with the handle 'postlist_thumb'.

Then install it in automated jobs.

Amazingly my cobbled together code actually works and generates the newsletter.xml file. I just need to figure out how to put the posts in date order. They are currently ordered by page ID.

Many thanks in advance

1 Attachment

rosie607
 
FaganSystems replied on at Permalink Reply
FaganSystems
HI,
I know this was some time ago, I am interested to know if this was resolved?
Also how are you including the resulting xml into the newsletter?

Thanks
Martyn