Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
658 views
in Q2A Core by
Q2A RSS feeds have good fields for Title, link, text, category, date, etc..   but they don't include tags.

 

I have an application that would really benefit from tags in RSS feed ..   

Any solutions?

Thanks
Q2A version: 1.6, 1.7

1 Answer

0 votes
by
edited by

I have also thought it strange.

My hack: qa-include/qa-feed.php (around L400)

Before:

if (isset($question['categoryname']))
    $lines[]='<category>'.qa_xml($question['categoryname']).'</category>';

After:

if (isset($question['categoryname']))
    $lines[]='<category>'.qa_xml($question['categoryname']).'</category>';

if (isset($question['tags'])) {
    $tags = explode(',', $question['tags']);
    foreach ($tags as $tag)
        $lines[]='<category>'.qa_xml($tag).'</category>';
}

If you are using Q2A only tag, it will not have a problem with this. However, if you are using both (categories and tags), it may be necessary to devise to distinguish between categories and tags. By the way, wordpress feed is also same.

One more hacks:

//if (isset($question['categoryname']))
//    $lines[]='<category>'.qa_xml($question['categoryname']).'</category>';
if (isset($question['categorybackpath'])) {
    $cats = explode('/', $question['categorybackpath']);
    $cats = array_reverse($cats);
    $cats = implode('/', $cats);
    $lines[]='<category>'.qa_xml($cats).'</category>';
}
if (isset($question['tags'])) {
    $tags = explode(',', $question['tags']);
    foreach ($tags as $tag)
        $lines[]='<category>'.qa_xml($tag).'</category>';
}

...