[TYPO3-dam] Showing captions of DAM images inserted in RTE

Francois Suter fsu-lists at cobweb.ch
Tue Apr 20 12:37:38 CEST 2010


Hi all,

I have a site with the DAM installed, and editors insert images from the 
DAM using the RTE. This works fine, except that the client would like 
some metadata to be displayed along with the image (like the 
description, the copyright notice, etc.).

Is there a simple way to achieve that? Having not found such a simple 
way, I did the following:

I looked at how images are rendered with the combination DAM/RTE and 
landed in class binding/imgtag/class.tx_dam_tsfeimgtag.php. It contains 
one method called renderTxdamAttribute() which renders the image based 
on information from the DAM. To identify the DAM record, it bases itself 
on the DAM uid which is passed using special attribute "txdam". Inside 
the method, this attribute is accessed as 
$this->cObj->parameters['txdam']. At the end of the method, this 
attribute is unset, so that it doesn't appear in the output <img> tag.

This unsetting is inconvenient because it means the "tx_dam" attribute 
is not available at a later point if one wants to change the rendering 
of the <img> tag. In my case if I still had this attribute in 
$this->cObj->parameters I could use it again in a later user func and 
retrieve all the info from the corresponding DAM record and display 
whatever is needed.

So unless I missed some simpler way, I would propose to change 
tx_dam_tsfeimgtag::renderTxdamAttribute() to not unset the "txdam" 
attribute and just be careful and not render it. This way the attribute 
survives and can be used at a later point.

What do you think?

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-project-dam mailing list