Skip to content

Question about passing through items using feedexpander #2745

Answered by yamanq
Deanosim asked this question in Q&A
Discussion options

You must be logged in to vote

At this time, categories (and uid) are not parsed by FeedExpander parseItem. I recommend that you open an issue to track this legitimate feature request.

The way to get around this is to use the original newsItem. This works for me:

		// Parse Categories
		$categories = array();
		foreach($newsItem->category as $cat) {
			$categories[] = (string) $cat;
		}

		if (!empty($categories)) {
			$item['categories'] = $categories;
		}

You can also do a similar thing to extract the uid:

		if (!empty($newsItem->guid)) {
			$item['uid'] = (string) $newsItem->guid;
		}

For the rest of your code, L43-L50 are unnecessary unless you are assigning to them (L47) because parent::parseItem() already extra…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Deanosim
Comment options

Answer selected by Deanosim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants