Warning
Starting from CubicWeb version 4.0 all code related to generating html views has been moved to the Cube cubicweb_web.
If you want to migrate a project from 3.38 to 4.* while still using all the
html views you need to both install the cubicweb_web cube AND add it to
your dependencies and run add_cube('web')
.
cubicweb_web can be installed from pypi this way:
pip install cubicweb_web
We donât plan to maintain the features in cubicweb_web in the long run; we are moving to a full javascript frontend using both cubicweb_api (which exposes a HTTP API) and @cubicweb/client as a frontend javascript toolkit.
In the long run cubicweb_api will be merged inside of CubicWeb.
XML and RSS views#
(cubicweb_web.views.xmlrss
)
Overview#
- rss
Creates a RSS/XML view and call the view rssitem for each entity of the result set.
- rssitem
Create a RSS/XML view for each entity based on the results of the dublin core methods of the entity (dc_*)
RSS Channel Example#
Assuming you have several blog entries, click on the title of the search box in the left column. A larger search box should appear. Enter:
Any X ORDERBY D WHERE X is BlogEntry, X creation_date D
and you get a list of blog entries.
Click on your login at the top right corner. Chose âuser preferencesâ, then âboxesâ, then âpossible views boxâ and check âvisible = yesâ before validating your changes.
Enter the same query in the search box and you will see the same list, plus a box titled âpossible viewsâ in the left column. Click on âentityviewâ, then âRSSâ.
You just applied the âRSSâ view to the RQL selection you requested.
Thatâs it, you have a RSS channel for your blog.
Try again with:
Any X ORDERBY D WHERE X is BlogEntry, X creation_date D,
X entry_of B, B title "MyLife"
Another RSS channel, but a bit more focused.
A last one for the road:
Any C ORDERBY D WHERE C is Comment, C creation_date D LIMIT 15
displayed with the RSS view, thatâs a channel for the last fifteen comments posted.
[WRITE ME]
show that the RSS view can be used to display an ordered selection of blog entries, thus providing a RSS channel
show that a different selection (by category) means a different channel