简体   繁体   中英

Custom RSS feed in Magento

I have been trying to follow a tutorial for creating a custom RSS feed with mixed success. I have followed it to a T, except that I only use the list and catalog_random block overrides instead of all the other ones that the tutorial references. My problem is that the block module is not triggered. The controller kicks in and calls the function, but the block is never executed (as proven by Mage::log() lines that do not print to the log files, but the controller does) .

The RSS feed I am trying to add involves pulling a random set of products from the database and displaying them in the RSS feed. In this aspect, how would I get a random set of products in a collection? I can fetch a collection file, but they are always the same set of products (expected, as I am not telling it to select random or anything in particular) and thats not what I need.

Lastly, the code .

Got it:

you have to add your random rss block to the Layout too, so go to the rss layout in your theme app/design/default/your_theme/layout/rss.xml

and just add:

<rss_catalog_random>
   <block type="rss/catalog_random" output="toHtml" name="rss.catalog.random" />
</rss_catalog_random>

f* 4+ hours to find that!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM