Fetch and display XML feed

Recommended Posts

I'm currently developing a website and we need to get some information from an external provider for display on a few different sections of the site. We have a couple of different options - an xml feed or information provided as an iframe. I'd rather go the XML route and have full control over how we display the information, but I've not really dabbled in XML before and I'm a bit lost on where to start with this.

Should it be possible to use the MarkupLoadRSS as a starting point for this?

Share this post

Link to post
Share on other sites

I've got it working and displaying the last 6 items from a test feed in a page using the MarkupLoadRSS module, would it possible to include pagination so you can go to the previous/next 6 results?

Share this post

Link to post
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.

  • Similar Content

    • By mtwebit
      I was looking for a module that allows the execution of long-running tasks (working with tens of thousands of pages) and could not find a suitable solution.
      It started with the import problem. I have lots of data in XML form (20k+ complex entries) that I want to import into ProcessWire.
      XMLReader() works fine but it takes a very long time to import all data so a simple "upload + process data on page save" would not work.
      So I've created a new module for this. Meet my first (well, third) PW module: Tasker.
      It's a simple module that executes long tasks in the background (using Cron or LazyCron) and reports their status to the user using a JQuery progressbar.
      Any suggestions are welcome. How do you solve similar problems?
      E.g. which is the best way to delete large number of pages? (max_exec_time will expire so I check it before the delete() call.)
      $children = $page->children('template='.$this->template.',include=all'); // creates lot of page objects, may not have time to delete all + ...->delete() OR $childIDs = $this->pages->findIDs('parent='.$page->id.',template='.$this->template.',include=all'); // will create page objects later + $pages->get(>delete() Be nice (I know you're always), I'm a PW-newbie, just started working with ProcessWire. I was developing sites with Drupal for a very long time but their non-existent module upgrade path finally has driven me away from it.
    • By Mike Rockett
      Docs & Download: rockettpw/markup-sitemap
      Modules Directory: MarkupSitemap
      MarkupSitemap is essentially an upgrade to MarkupSitemapXML by Pete. It adds multi-language support using the built-in LanguageSupportPageNames. Where multi-language pages are available, they are added to the sitemap by means of an alternate link in that page's <url>. Support for listing images in the sitemap on a page-by-page basis and using a sitemap stylesheet are also added.
      Example when using the built-in multi-language profile:
      <url> <loc>http://domain.local/about/</loc> <lastmod>2017-08-27T16:16:32+02:00</lastmod> <xhtml:link rel="alternate" hreflang="en" href="http://domain.local/en/about/"/> <xhtml:link rel="alternate" hreflang="de" href="http://domain.local/de/uber/"/> <xhtml:link rel="alternate" hreflang="fi" href="http://domain.local/fi/tietoja/"/> </url> It also uses a locally maintained fork of a sitemap package by Matthew Davies that assists in automating the process.
      The doesn't use the same sitemap_ignore field available in MarkupSitemapXML. Rather, it renders sitemap options fields in a Page's Settings tab. One of the fields is for excluding a Page from the sitemap, and another is for excluding its children. You can assign which templates get these config fields in the module's configuration (much like you would with MarkupSEO).
      Note that the two exclusion options are mutually exclusive at this point as there may be cases where you don't want to show a parent page, but only its children. Whilst unorthodox, I'm leaving the flexibility there. (The home page cannot be excluded from the sitemap, so the applicable exclusion fields won't be available there.)
      Sitemap also allows you to include images for each page at the template level, and you can disable image output at the page level.
      The module allows you to set the priority on a per-page basis (it's optional and will not be included if not set).
      Lastly, a stylesheet option has also been added. You can use the default one (enabled by default), or set your own.
      Note that if the module is uninstalled, any saved data on a per-page basis is removed. The same thing happens for a specific page when it is deleted after having been trashed.
    • By nuel
      hi there
      i'm new to processwire, please cut me some slack if the answer is already out there..
      i am "processwiring" a non-cms page that i made, containing many repeating so called "station"-elements with fields such as date, location, miles, optional links, photo upload etc. they were listed and created via php and stored in an xml file until now:
      <stations> <station> <date>17.8.2017</date> <location>Exil, Zurich</location> <miles>1234</miles> ... </station> <station> ... </station> </stations> i already created a working repeater field with the needed fields and successfully created the first two elements... but there are many more!
      what is the easiest and quickest way to batch create new repeater fields with the node element content of my xml file?
      otherwise i would just have to type the whole sh..t again which i am too damn lazy to do
      thanks in advance
    • By timothy.m.wilson
      Good afternoon,
      I am attempting to loop through approximately 600 XML nodes. Each of those nodes has 2 child nodes (example below). One is an id for an existing page and the other contains values for a page reference field. I have put together a loop (below as well) to attempt to save each page with the label values. This all works....once. After getting the first XML node "label" saved to the correct page, nothing else is saved. I'm sure there is probably something that I have overlooked. But, I am also very new to this CMS. I'm hoping there is a veteran user who may be able to point me in the right direction. 
      foreach ($xml->row as $items) {
              //get page id to update and set output formatting to false
              $blog_page = $pages->get('id='.$items->id);
              //create array from pipe separated label values
              $labelsArray = explode('|', $items->labels);
              //loop through array to get page ids by page name
              $labelIDS = array();
              foreach ($labelsArray as $labelValue) {
                  $labelPage = $pages->get('name='.$labelValue);
                  array_push($labelIDS, $labelPage->id);
              //add labels to label field in post
              $blog_page->labels = $labelIDS;
              //save page
    • By Tyssen
      I'm going to be building a real estate website soon and am exploring my options. The site will have some pages that will be native to PW, but all their property listing information will come from an XML feed from an external provider.
      What's the best way to approach this? I've come across but is it possible to do searching, categorisation and pagination using that?
      Or is there a better way to approach it?