User Tools

Site Tools


Sidebar

tutorials:feeds:rss

This is an old revision of the document!


RSS Feed

You can find the RSS feed in your software, named rss_listings.php. If you do not make any changes at all to the file, by default it will show 20 of the most recently placed listings. With a few configuration changes, you can make it show however many listings as you want, filtered by whatever criteria you wish. Further down on this page is instructions for the most common configuration used other than the default, which is to show RSS feed based on what category is currently being viewed.

If you are not familiar with what RSS is, you can find information on this RSS Introduction from w3schools.com, an excellent resource.

<tip c n>Note that the rss link within the front_page.tpl template of the default design does not link to this feature by default. They link to the support wiki for setting up this feature when installed. If you do not wish to use this feature you'll need to edit the front_page.tpl template to remove that link. If you wish to use that feature you'll need to edit the rss link in the front_page.tpl template to point to the rss feed you want.</tip>

How to use Category Specific Feed

These instructions will walk you through the steps needed, to allow the RSS feed used when browsing categories, only use listings found in the category currently being viewed. Note that the default templates already "link" to the RSS feed which shows the most recent 20 listings placed from all categories on the site. This will make it so that when you browse to a category, the "linked" RSS feed only shows classifieds and auctions recently placed in that category.

Skills

  • Comfortable with using FTP (to upload and download files from your site) <
  • Basic understanding of how PHP works will help, but not necessary. <

Instructions

  1. In the "base" of where the software is installed, the same folder that the rss_listings.php file is located, create a new file named rss_listings.config.php. This file will overwrite the settings in the rss_listings.php file, without actually editing that file, so that the setting changes we make will not be un-done when the software is updated. In the file, add the contents1):
    <?php
    //rss_listings.config.php - settings for the rss_listings.php feed
     
    //Allow category ID to be specified in the URL
    $feed->catId = geoListingFeed::URL_SET;

    <

  2. Save the file and upload it, remember it should be located in the base of the Geo installation, in the same folder as rss_listings.php file. <
  3. Log into your admin panel, and go to the page Design > Manager, then navigate to the template file head.tpl inside the main_page folder, in your template set. <
  4. Download a copy of the head.tpl file, and save it in a safe place, so that you can restore it if needed. <
  5. Now edit the head.tpl file, and find:
    <link rel="alternate" type="application/rss+xml" title="Newest Listing Feed" href="rss_listings.php" />

    <

  6. Replace with:
    <link rel="alternate" type="application/rss+xml" title="{if $category_id}Category{else}Newest{/if} Listing Feed" href="rss_listings.php{if $category_id}?catId={$category_id}{/if}" />

If you cannot find the line to replace, you would add the above right before the </head> in your template file. <tip c n>Note: Does your template design work differently than the default templates? If you do not have a head.tpl file or some of your templates do not use that file for the <head>…</head> section, just add the following line to your design where you do have the <head> section:

<link rel="alternate" type="application/rss+xml" title="{if $category_id}Category{else}Newest{/if} Listing Feed" href="rss_listings.php{if $category_id}?catId={$category_id}{/if}" />

</tip> <

  1. Save the changes. <
  2. Now browse the categories on your site. When you browse a category with listings in it, view the RSS feed for the page2). If it shows only listings in the category you were just browsing, you're done! <
1)
In this tutorial, it only changes the catId setting to make it use the category ID specified in the URL. There are many more settings you can customize, which are documented in the rss_listings.php file. Any of the settings you want to change, you can copy/paste to your rss_listings.config.php file.
2)
Most modern browsers have a way to view or subscribe to an RSS feed for a website. You can usually find an RSS Icon that looks similar to Common RSS Icon located in or around the URL bar in the browser that you can click on to view the RSS feed for that web page.
tutorials/feeds/rss.1343086174.txt.gz · Last modified: 2014/09/25 16:55 (external edit)