Author Topic

Łukasz Serwatka

Tuesday 07 October 2008 1:27:54 pm

Comment50234

Hi,

This is used to create your own RSS field definition array:

Basically you need to create a class which implementing rssFieldDefinition public method

Example extension:

// class name is construct as <active_extension> +  'rssimport'
// 'rssimport' suffix must be part of class name
class MyCustomFieldsrssimport
{
    public function rssFieldDefinition()
    {
        return array( 'item' => array( 'elements' => array( 'title',
                                                                    'link',
                                                                    'description',
                                                                    'author',
                                                                    'category',
                                                                    'comments',
                                                                    'guid',
                                                                    'pubDate' ) ),
                              'channel' => array( 'elements' => array( 'title',
                                                                       'link',
                                                                       'description',
                                                                       'copyright',
                                                                       'managingEditor',
                                                                       'webMaster',
                                                                       'pubDate',
                                                                       'lastBuildDate',
                                                                       'category',
                                                                       'generator',
                                                                       'docs',
                                                                       'cloud',
                                                                       'ttl' ) ) );
    }
}

Put that class in

extension/MyCustomFields/rss/MyCustomFieldsrssimport.php

Then enable it in site.ini.append.php as

[RSSSettings] 
ActiveExtensions[]=MyCustomFields

Clear all the cache and go to admin interface, then check available filed definition in RSS import.

Beware of typos, I did not test it with Exponential instance.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog