Dynamic Web Development with Seaside

19.4Subscribe to the Feed

Now we have done all that is required to let users subscribe. Below you can see how the feed is presented to the user in the feed reader when the URL was added manually.

The ToDo Feed subscribed

One remaining thing to do is to tell the users of our todo application where they can subscribe to the RSS feed. Of course we could simply put an anchor at the bottom our web application, however there is a more elegant solution. We override the method WAComponent>>updateRoot: in our Seaside component to add a link to our feed into the XHTML head. Most modern web browser will pick up this tag and show the RSS logo in the toolbar to allow people to register for the feed with one click.

ToDoListView>>updateRoot: aHtmlRoot
super updateRoot: aHtmlRoot.
aHtmlRoot link
beRss;
title: self model title;
url: 'http://localhost:8080/todo.rss'

Note the use of the message beRss tells the web browser that the given link points to an RSS feed.

In Firefox you may have to add the relationship property to make the rss logo visible.

updateRoot: aHtmlRoot
super updateRoot: aHtmlRoot.
aHtmlRoot link
beRss;
relationship: 'alternate';
title: self model title;
url: 'http://localhost:8080/todo.rss'

Copyright © 19 March 2024 Stéphane Ducasse, Lukas Renggli, C. David Shaffer, Rick Zaccone
This book is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.

This book is published using Seaside, Magritte and the Pier book publishing engine.