Using the built-in eZ Publish RSS import feature to syndicate ez.no news
Following steps similar to those in Paul Wilson's RSS import "how to" guide, we were able to quickly set up the syndication of the ez.no company news feed. This way, ezsystems.ca visitors can get a quick summary on the front page of what's new at eZ Systems in general, such as the much anticipated eZ Publish 4.0 release, which runs on PHP 5!
You might have noticed the ez.no News section below the listing of the latest blog posts on the ezsystems.ca front page:
Because the process is quite well documented in Paul's guide, we will provide only a brief outline here about the steps we took to set up the RSS import.
-
Create a folder in the node tree to contain the imported items.
For us, this is the ez.no News folder. -
Create a custom class (under the Classes menu in the Setup tab of the Administration Interface. Analyze the fields in the source RSS feed that you want to import, in order to determine the appropriate attributes in the custom class.
For us, under each "item" tag we wanted the pubDate, title, link (not visible in the screenshot) and description. Therefore, we created corresponding attributes in a custom "eZ News" class.
-
Set up the RSS import under the RSS menu in the Setup tab of the Administration Interface, mapping the fields from the source RSS feed to the class attributes.
- Set up a cronjob, if this hasn't already been done, to run the runcronjobs.php script periodically. This script manages all of the cronjobs in eZ Publish, such as the workflow processes, notifications, and RSS importing.
-
If needed, create a template for your custom class. Depending on what you are importing, you could base this template on an existing template, such as an article. Because ezsystems.ca is based on the Website Interface, we placed the new template in the extension/ezwebin/design/ezwebin/override/templates/full/ folder. You should also edit the override.php override for your siteaccess. In our case, we placed the following code in extension/ezwebin/settings/override.ini.append.php.
[full_ez_news] Source=node/view/full.tpl MatchFile=full/ez_news.tpl Subdir=templates Match[class_identifier]=ez_news
-
Because we wanted to syndicate the news on our front page, we simply edited the front page object and embedded our eZ News container folder, setting its class to itemized_sub_items and configuring it to show the latest five objects.
A special thanks goes to Paul for his wonderful contribution, which is one of the hundreds of eZ Community contributions!
Comments