Image Title

Permalink
Hi,

I am looking for a solution for the missing title tag of images via image-blocks.
I could include the phrase "title=\"my title\" in the img-statement of controller.php in concrete/blocks/image or in blocks/image. But I don't know how to get access to file attributes (i.e. file description - field fvDescription in database-table FileVersions). This could be an easy way to handle titles for images: write a description via file manager and output it via controller.php

What do you mean ? Is there already such a solution ?

 
adajad replied on at Permalink Best Answer Reply
adajad
there are functions for the file version object, so if you have the fileID, you can get it with:

$f = File::getByID($fileID);
$fv = $f->getApprovedVersion(); //use approved version instead of most recent
$fileDescription = $fv->getDescription(); //description of the file
$fileTitle = $fv->getTitle(); //name of the file


More info here: http://www.concrete5.org/documentation/developers/files/files-and-f...
pankraf replied on at Permalink Reply
Thank you very much, this works very fine.