Jump to content

RSS Feed Module


ryan

Recommended Posts

Chrome inspector gives me a 404 error for the xsl: 

Failed to load resource: the server responded with a status of 404 (Page Not Found)

perhaps comment out that line in the .module file and see if it fixes the issue.

I downloaded your xml file, removed

48 minutes ago, Peter Falkenberg Brown said:

<?xml-stylesheet type='text/xsl' href='/site/templates/styles/rss_feed.xsl' ?>

and loaded it in Chrome - everything is viewable normally.

 

Link to comment
Share on other sites

@Peter Falkenberg Brown are you sure you don't have it improperly configured? The only way to get the module to output the XSL stylesheet would be if you set that in the module config. You shouldn't have to comment out any code.

this is the config setting:

https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L258

this line means it would only output XSL if you entered the path to that stylesheet in your settings:

https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L90

  • Like 1
Link to comment
Share on other sites

Hi Macrura,

You are exactly right.

I don't remember placing this line in the module backend data field "Default Link to XSL Stylesheet"

"/site/templates/styles/rss_feed.xsl"

but it was there.

So, I removed it, and then uncommented the line in the module, and all was well.

I suppose I could have placed that value in the data field: I just don't remember doing so, and never had that file on my system.

Oh well... mystery solved, and the module has no error.

It was human error! Oy. Ugh. :-)

Thank you VERY much for clarifying this.

Peter

 

Link to comment
Share on other sites

Hello all,

I need help adding the <content:encoded> tag containing body field content into the feed output. 

Reason being is that I have been tasked with importing blog posts from one of our sites into a new system and it will not work without the appropriate content tags.

I am not a php developer so excuse my ignorance. Any help that you can provide would be greatly appreciated.

 

Link to comment
Share on other sites

  • 1 month later...

Hi there -

is there a way to include the first image and the body of a page to the "itemDescriptionField" without leaving $rss->render($items); ?

In my case this happend automatically for the frontend output, so I'm searching for a way to integrate the images in my feed.

Thanks in advance.

Thorsten

Link to comment
Share on other sites

  • 1 year later...

I realize this is an old module, and RSS is hardly new sexy stuff, but RSS feeds are a great "glue" between products. Im trying to get an RSS feed out of a PW site and did the following steps:

  • Turned on the Module from Core.
  • Left all module options default. 
  • Copied example code into a new file called rss.php in my /site/templates directory.
    • changed items to get a page by ID:
      $items = $pages->get(111)->children();
  • In ProcessWire, went to add a new template, selected the rss file. Left the template blank with no fields. 
  • Created a new page with RSS template. Viewed page and got no output—visibly blank, and view source is an empty line.

I'm probably tripping over my own shoelaces here, but thanks for any advice. 

  • Like 1
Link to comment
Share on other sites

4 hours ago, adickman said:

I'm probably tripping over my own shoelaces here, but thanks for any advice. 

This is when you gotta do some debugging. Some things to try...

  • Set $config->debug to true to make sure you are seeing error messages.
  • Install Tracy Debugger - the debug bar is great at catching error/warning messages that debug mode sometimes misses.
  • Dump $items with Tracy Debugger to see if there's actually any pages in there: bd($items);
  • Not sure if the line of code you showed is just a demo or your real code, but 111 is not going to be the ID of a front-end page because these start at 1000.

Welcome to the forums BTW ?

Link to comment
Share on other sites

  • 6 months later...

I can’t list my selected page, just like @adickman. I suspect it is related to the page or field permissions because 1. I can see other templates (basic-page for instance), 2. if I comment the viewable condition in the MarkupRSS module, I can see my feed correctly.

I also tried to check the “Make field value accessible from API even if not viewable (see below)*” box on my template page but it does not work.

What else can cause a page’s template to be inaccessible from the API?

Link to comment
Share on other sites

  • 2 weeks later...

I can’t figure what is happening: I can echo the page I select using find("template=…") but when I pass it to render() nothing is listed. Everything works fine with the basic-page template however.

$items = $pages->find("template=basic-page"); // working
$items = $pages->find("template=ressource"); // not working with my custom template

$rss->render($items);

 

Link to comment
Share on other sites

  • 3 months later...

Just in case it helps anyone else, after upgrading from PW core 3.0.148 to latest (3.0.161), the ending bracket gets striped from the CDATA element when generating the output for the RSS XML feed.  Not sure what has changed or caused this.

Changed line 187 from:

$description = '<![CDATA[' . $description . ']]';

to:

$description = '<![CDATA[' . $description . ']]>';

Thanks.

  • Thanks 1
Link to comment
Share on other sites

  • 1 year later...

Today I used this module for the first time to implement an RSS feed into an exiting website.
On my local dev enviroment, everything worked well. But on the live website I get a error, when umlaute (ä,ö,ü) are present in the title field. The error looks like this:

This page contains the following errors:
error on line 4 at column 51: Entity 'uuml' not defined
Below is a rendering of the page up to the first error.

Here is the code to render the RSS feed (if I comment out the part $rss->title and $rss->description, it works)

<?php namespace ProcessWire;

// retrieve the RSS module
$rss = $modules->get("MarkupRSS");

// configure the feed. see the actual module file for more optional config options.
$rss->title = "ATLAS ist das Kundenmagazin von Gebrüder Weiss";
$rss->description = "ATLAS ist das Kundenmagazin von Gebrüder Weiss.";
$rss->itemDescriptionField = 'textarea';

// find the pages you want to appear in the feed.
// this can be any group of pages returned by $pages->find() or $page->children(), etc.
$items = $pages->find("template=artikel, limit=10, sort=-parent, sort=sort");

// send the output of the RSS feed, and you are done
$rss->render($items);
?>

EDIT:
My local PW version is 3.0.150 and my live PW version is 3.0.165.
After replacing the module file (MarkupRSS.module) from the live site with the older version from my local site, everything is working fine. So there seems to be an issue with the newer version.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...