Allow modules to make enclosures

ekes - February 17, 2008 - 13:25
Project:Atom
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:patch (code needs review)
Description

Presently all data is just presented as html CDATA in summary and content. This isn't so useful for media like videos which can be in

AttachmentSize
atom extensibility DRUPAL-5 20080217.patch5.67 KB
atom extensibility DRUPAL-6 20080217.patch4.04 KB

#1

ekes - February 17, 2008 - 13:27

Oops, always remember to preview! Full text, without unescaped < :-

Presently all data is just presented as html CDATA in summary and content. This isn't so useful for media like videos which can be in <link rel="enclosure" ... allowing readers and parsers to deal with them appropriately.

The best way to do this is as presently happens with RSS is to allow modules to create their own. To do this I've added an hook_atom_feed that can be used.

To make this truly extensible I've allowed modules to, optionally of course, add configuration options and additional namespaces. Presently in the Video example I'm just using this to turn on and off enclosures, but it could be used by CCK modules to correctly assign field to element. It could also allow elements in, different namespaces - probably useful for date fields, or implementing Dublin Core for all fields... for example.

The DRUPAL-5 patch includes the video.module example. I've not found a module already ported to 6 that I can productively use time to make an example for that patch yet, but I've rolled it for the possibility.

#2

ekes - February 24, 2008 - 12:55

HEAD patch tested against an example test cck type and committed.

 
 

Drupal is a registered trademark of Dries Buytaert.