Results 1 to 6 of 6

Thread: RSS Feed Includes

  1. #1
    Join Date
    Apr 2006
    Posts
    447

    Default RSS Feed Includes

    Quick question -- is there an easy way to have a specific feed apply to a parent category and ALL of its subcategories? For example, I have set up the following in browse:

    <%if $cat == 184%>
    <%block_rss_feed url="http://news.google.com/news?hl=en&ned=us&q=cosmetic+dentistry+&ie=UTF-8&output=rss" title="US Cosmetic Dental News" template="block.rss_feed.html" max_item="5" cache_time="86400"%>

    <%else%>

    <%block_rss_feed url="http://news.search.yahoo.com/news/rss?p=dental&toggle=1&cop=&ei=UTF-8&eo=UTF-8" title="General US Dental News" template="block.rss_feed.html" max_item="4" cache_time="86400"%>
    <%/if%>

    This works to put the cosmetic dentistry feed on the one parent category page (cosmetic dentistry 184). Unfortunately, all of the subcategories default to the generic dentistry feed (general dentistry news).

  2. #2
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    You should know the id of subs category too.
    For example the subs categories are 289, 583, 599,849

    <%if $cat == 184 OR $cat == 289 OR $cat == 583 OR $cat == 599 OR $cat == 849%>

  3. #3
    Join Date
    Apr 2006
    Posts
    447

    Default

    sorry ... i was searching for an easier/more efficient method/command. there are more than 5000 subcategories.

  4. #4
    Join Date
    May 2004
    Location
    New Zealand
    Posts
    600

    Default

    im not sure on how your setup is, but what about maybe using the parent id value of the categories

    would that be of any use?

    Cheers Ezy

  5. #5
    Join Date
    Apr 2006
    Posts
    447

    Default

    thanks, ezy. as noted in my original post, the parent category is 184 - or cosmetic dentists. while it works for 184 (one "page"), it does not apply to its subcategories. but i agree, surely there must be a way of using the parent. otherwise its a huge task, and a management nightmare.

  6. #6
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    You can use parent_id to get the sub categories. I think it's wiser to hack browse.php instead of smarty.

    To get the sub categories, you may use GetChildren($cat) method from /lib/category.class.php

    In browse.php, call
    PHP Code:
    $children $category_obj->GetChildren($cat
    It will return an array of sub categories.

Similar Threads

  1. Category RSS feed?
    By inspireme in forum v5.x
    Replies: 22
    Last Post: 09-27-2006, 01:52 AM
  2. Add the XML feed from IndexU
    By baggiho in forum v5.x
    Replies: 0
    Last Post: 06-19-2006, 01:27 PM
  3. About PPC XML feed
    By baggiho in forum v5.x
    Replies: 0
    Last Post: 05-06-2006, 09:53 AM
  4. Problems with includes again
    By Jester in forum v5.x
    Replies: 7
    Last Post: 02-27-2003, 03:41 PM
  5. Includes on index.php won't work?
    By Carrie in forum v5.x
    Replies: 5
    Last Post: 09-23-2002, 06:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •