Show
Ignore:
Timestamp:
05/25/06 17:04:25 (6 years ago)
Author:
nick
Message:

Include the categories in the Feeds, in the appropriate places

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/lib/Wiki/Toolkit/Feed/Atom.pm

    r310 r312  
    154154       $title =~ s/>/>/g; 
    155155 
    156     # TODO: Store categories in the atom:category element (4.2.2) 
     156    # Pop the categories into atom:category elements (4.2.2) 
     157    # We can do this because the spec says: 
     158    #   "This specification assigns no meaning to the content (if any)  
     159    #    of this element." 
     160    # TODO: Decide if we should include the "all categories listing" url 
     161    #        as the scheme (URI) attribute? 
     162    my $category_atom; 
     163    if($node->{metadata}->{category}) { 
     164        foreach my $cat (@{ $node->{metadata}->{category} }) { 
     165            $category_atom .= "    <category term=\"$cat\" />\n"; 
     166        } 
     167    } 
     168 
    157169    # TODO: Find an Atom equivalent of ModWiki, so we can include more info 
    158170     
     
    165177    <updated>$item_timestamp</updated> 
    166178    <author><name>$author</name></author> 
     179$category_atom 
    167180  </entry> 
    168181};