Advanced feed options
Item field keys
If your list of items contains different field keys than the plug-in is expecting, you can specify different keys using the “field” method. The first parameter is the normal name, and the second is the key it needs to look for. For example, if your description is stored using the key “summary”, use:
$feed->field('description', 'summary');
You can change the field keys title, description, timestamp, link, and datetime.
Dates instead of timestamps
The default is to look for a timestamp in the timestamp key. But if your dates are stored in a more human-readable form such as a SQL date or datetime, you can specify a field key for the “datetime”:
$feed->field('datetime', 'post_date');
This both tells the system to look for the publication date using the key “post_date”, and it tells the system that the publication date is not a timestamp.
Base Item URL
If your items do not contain a full URL to where you need the feed to link to, you can specify a base URL that gets prepended to whatever the link key returns. For example, if your “link” is actually an article page, you can specify that the item’s display page is:
$feed->itemPage('http://www.sandiego.edu/mysite/news/articles/');
So, for example, the actual URL for each item will be something like http://www.sandiego.edu/mysite/news/articles/sunday-girls.
Base enclosure URL
If your enclosures do not contain a full URL, you can specify a base URL that gets prepended to the enclosure data.
$feed->enclosureFolder('http://www.sandiego.edu/images/news/heads/');
So, for example, the actual URL for “john.png” will be http://www.sandiego.edu/images/news/heads/john.png.
