[TYPO3-RTE] Special rendering for DAM MP3 links

Stanislas Rolland typo3 at sjbr.ca
Tue Aug 19 17:21:24 CEST 2008


Hi Jochen,
> 
> what would be the best way to achieve the following:
> 
> - editor should be able to pick an mp3 via DAM file browser
> - rendering in frontend would then render a flash player <object>-tag
>   using the original link's target as param
> 
Here is my suggestion:

1. Create a TYPO3 extension that will add a new "Multimedia" plugin to
htmlArea RTE (see
http://typo3.org/documentation/document-library/extension-manuals/rtehtmlarea_api_manual/1.7.4/view/). 

The new plugin will add a new button "Insert/modify multimedia" which
will behave in a manner very similar to the "Insert/modify image".
Instead of inserting an img tag, it will insert an object tag.

2. The object tag inserted in the RTE would have a custom attribute
named txdam whose value would be set to the dam id of the media to be
rendered. Note that, in Firefox, only the contents inside the object tag
will be rendered in the RTE. So, something meaningful alternate content
would have to be inserted there for the editor, and for the frontend
when browser rendering fails. Some more research and tweaking would be
required for IE. In the worst case, the object tag may need to be 
transformed depending on browser.

3. If the editor wants to specify some parameters, this would be done in
a "Modify multimedia" tab (enabled when the cursor is positioned inside
an object tag), and would insert/modify some param tags inside the
object tag.

4. Some Page TSConfig will be required to allow the object and param
tags in the RTE (embed tag will not survive in IE7):
RTE.default.proc.allowTags := addToList(object, param)
RTE.default.proc.entryHTMLparser_db.allowTags := addToList(object, param)

5.  On the frontend, create a postprocessing function for the object
tag.  This function should get the metadata about the DAM media referred
to by the txdam attribute, and render the correct object tag with
whatever appropriate param and embed tags.

Best regards,
Stanislas



More information about the TYPO3-project-rte mailing list