Sidebar

startup_tutorial_and_checklist:feature_configuration:exporting_listings:rss_feed:category_specific_example

Category Specific RSS Feed Example

These instructions will walk you through the steps needed, to allow the RSS feed used when browsing categories, only use listings(classifieds & auctions) 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(classifieds & auctions) 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(classifieds & auctions) in it, view the RSS feed for the page2). If it shows only listings(classifieds & auctions) 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.
startup_tutorial_and_checklist/feature_configuration/exporting_listings/rss_feed/category_specific_example.txt · Last modified: 2014/09/25 16:55 (external edit)