A feed (or news feed) is a data format used for providing users with frequently-updated content, such as news for a site, or posts for a blog. A feed can be provided in different formats, such as RSS or ATOM, and can be subscribed by a user with a feed reader application.
Adding feeds to a site is very important because it provides users with the latest content without them having to visit the site.
By default, eZ Publish doesn't provide a self-generated feed. However, it does provide an option for the site administrator to enable one from the administration interface.
Moreover, any node of the content tree can be used to generate a feed, through a very flexible system that can handle any kind of content class.
We will add a feed to the forums and the blog, choosing the best class attributes for both.
Log in to the backend. From the Setup tab, we will click on the RSS link in the left-hand sidebar.
Next, click on the New Export button and complete the form with the necessary data for our new feed, which is a Name, a Description, and a Site URL.
In this form, eZ Publish will require some information regarding the feed itself, as we can see in the following screenshots:
The feed information includes the following:
/articles/my_article
). Leave this field empty if you want the system to automatically detect the URL of your site from the URL that you access the feed with.After we define the feed's information, we have to configure the sources from where we want to retrieve the objects to be taken for the feed. We can do this by completing the Source 1 subform as shown:
To configure the feed source, we have to define:
When we configure the Source path, by clicking on the Browse button, eZ Publish will ask us to choose the node that we want to use to create the feed.
As shown in the previous screenshot, we will select the blog node as the primary source. This will ask the system to check for content only in that node, and to not use the whole site.
Next, we will choose which classes we want to include in the feed, and which class attributes should be used for the feed title and content.
For the blog, we will use the Blog post class. After we click on the Set button to refresh the class attributes, we will select the Title and Body attributes for the feed Title and Description respectively.
Next, click on the OK button to save your settings and check for the feed.
You can see if the feed is enabled by taking a look at the navigation toolbar in any modern browser. For example, in any 3.x version of Firefox, the feed icon will appear on the left-hand side of the domain name. This is seen in the following screenshot:
We have an additional requirement for the forum. We want to include all of the new discussions in a single feed, which will create a kind of aggregate feed.
As before, click on the New export button from the RSS setup page, and complete the form by specifying the required feed information, such as the feed Name, Description, and Site URL as shown in the following screenshot:
The main difference between this and the previous example is in the Source 1 subform, where we will select the /Homepage/Forum as the Source path, and select the Subnodes checkbox. This is shown in the following screenshot:
This setting will cause a full parse of the selected node to be made, in order to check if any subnodes with the specified content class exist, and will then add any such subnodes to the feed.
Multi-source feed
eZ Publish allows us to create a multi-source feed. For example, if we create some blogs on different document tree nodes, we can include all of them in our feed by using the Add source button in the RSS edit page. In fact, clicking on that button will create a new sub-section called (in our case) Source 2, where we can configure a new Source Path that will be merged with the one that we configured before.
18.223.108.119