The Artima Developer Community
Sponsored Link

Python Buzz Forum
Feed Control

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ng Pheng Siong

Posts: 410
Nickname: ngps
Registered: Apr, 2004

Ng Pheng Siong is just another guy with a website.
Feed Control Posted: Dec 26, 2004 8:58 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ng Pheng Siong.
Original Post: Feed Control
Feed Title: (render-blog Ng Pheng Siong)
Feed URL: http://sandbox.rulemaker.net/ngps/rdf10_xml
Feed Description: Just another this here thing blog.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ng Pheng Siong
Latest Posts From (render-blog Ng Pheng Siong)

Advertisement

Earlier I posted a test entry in Chinese, in UTF8. Eventually I hope to create a new blog in Chinese; for now, I just want to play, so I made a category in this blog for entries in Chinese specifically.

The main feed for this blog contains the entries for the last ten days in reverse chronological order. Now, I imagine that most of the present readership of this blog do not read Chinese, so I decided to make the main feed skip that particular category.

As it happens, it was easily done: The COREblog method used by the main feed is 'rev_day_entry_items()', which signature looks like this:

rev_day_entry_items(self,count=1,start_year=0,start_month=0,start_day=0)

The actual call looks like this:

<dtml-in "rev_day_entry_items(count=top_days)">
 ...
</dtml-in>

I wanted the output of this method to skip certain categories, so I added a keyword parameter to the signature, making this thus:

rev_day_entry_items(self,count=1,start_year=0,start_month=0,start_day=0,skip_cat=[])

'skip_cat' is a list of category ids to skip. The method body is changed to add a test for non-membership in skip_cat, a one-liner mod.

The call becomes this:

<dtml-in "rev_day_entry_items(count=top_days,skip_cat=['13'])">
 ...
</dtml-in>

Voila! (I say that a lot on this blog. ;-) The main feed now skips the Chinese category. For the interested party, here is the Chinese entries-only feed.

Read: Feed Control

Topic: I want a new duck Previous Topic   Next Topic Topic: Notes

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use