Blog

The upcoming new template system!

In my work with Feed Digest, one of the constant limitations is the template system. I want users to have as much control as possible over their digests, and while the existing template system hasn't been bad, it's far from ideal.

Currently users can give an optional header and footer template and a 'per item' template. So their per-item template might look something like this:

<p><a href="%URL%">%TITLE,40%</a>.. %DESCRIPTIONPLAIN%</p>

Quite simple. A paragraph for each item in the digest with a link using a truncated title (to 40 characters) followed by a HTML-stripped description. But.. for anything more complex than this, it begins to suck. So, I've invented a language called MoFo. It stands for "Markup Output Format" but the name is as much humorous as practical. It is markup itself, so doesn't have the best name. It'll do for now though. With MoFo you can do things like this:

<% foreach source in sources %>

    <p><b><%= source->title %></b></p>

    <ul>

    <% foreach entry in source.entries %>


        <li><a href="<%= entry->url %>"><%= entry->title %></a></li>

    <% end %>

    </ul>


<% end %>

It's basically a more extensive language which will allow me (as well as advanced FeedDigest users) to develop more templates for FeedDigest users in a quicker time. I'll also be able to use it to develop RSS and Atom templates in varying formats, as opposed to the two 'fixed' RSS and Atom templates now. Users will be able to create their own WML/WAP templates, OPML templates, and, well, anything they want on each digest.

MoFo doesn't have much logic in it yet, but this is all being developed right now. Eventually if it has anything to do with feeds and content redistribution in the vaguest, Feed Digest will be the #1 API and developer platform to use. The easy stuff will be even easier, and the complex stuff will now be possible.

More news to come as this stuff begins to roll out..

4 Comments

  1. Is there a way to save a template we create for use in other digests? Currently I have to go through and copy and paste to each of my 68 feeds, and it’s difficult to keep it consistent. I would really like the ability to store templates to select from the pre-formatted menu. Is there a way to do this?

    Posted July 9, 2007 at 2:48 pm | Permalink
  2. In this case, unfortunately not. A few other users have had the same question though, so it’s something we’re aware of. Again it’s something we anticipated but which the user end side of things is just not there.

    Posted July 9, 2007 at 3:02 pm | Permalink
  3. I’m going to give it a little attempt now to see if this is easy for me to just add on. I’m thinking it might be.. I’ll post an update to the forum (not here, as I’ll forget) when it’s done. So please keep an eye on /forums/ or post a thread there and subscribe to it.

    Posted July 9, 2007 at 3:03 pm | Permalink
  4. I’ve just implemented the timezone support, so that’s one thing.. but I’ve just realized why templates have been a trickier issue. The problem is that templates are only used once, to populate info related to a digest. That is, if we update a template, it doesn’t update any digests.. digests simply take a COPY of the main templates when they are created, and then that’s it (unless you choose a new template). Most users would expect to edit a personal template and have it take effect on all digests that use that template.. but that’s not how our system works (for good reason, users would be angry with us if we changed their templates automatically from the global templates).

    Posted July 9, 2007 at 3:30 pm | Permalink