Retrieve image title and description from file manager

Permalink 1 user found helpful
Is it possible to retrieve image titles and descriptions as they were set in the file manager?

View Replies:
jaredquinn replied on at Permalink Reply
jaredquinn
Why, yes it is!

Where $f is a File object:

$title = $f->getApprovedVersion()->getTitle();
$desc = $f->getApprovedVersion()->getDescription();
quantumleap replied on at Permalink Reply
Thanks but how will I display it? I mean, I am trying to modify a view.php of the multimedia box addon cause the developer is not helping a lot unfortunately, so even though I don't know a lot about PHP, I will try to do my best. The addon generates a list of thumbnail images that when clicked load up a lightbox with images, audio or video. When I see the generated html page all items have alt and title tags and I need to display those tags somehow. I would imagine that I would need to throw them in an array and then create a for loop that scans through all of them. Is that so?
jaredquinn replied on at Permalink Reply
jaredquinn
That sounds like something that needs to be done within your particular lightbox plugin.

Which one are you using?
quantumleap replied on at Permalink Reply
jquery.prettyPhoto. But I think what I am trying to achieve is supposed to be done on the view.php outside the lightbox.
teddadore replied on at Permalink Reply
teddadore
I needed to display the same thing in a view.php to a similar add-on. I added this to my view.php file:

<?php
$title = $f->getApprovedVersion()->getTitle();
echo $title;
?>


in a div area that I wanted it to display in the view.php
tsilbermann replied on at Permalink Reply
tsilbermann
Anyone knows just to show a description (or a div with description in it) when a description is entered?