Random Image - Display Image Text with Image

Permalink
Looking for a way to add the 'Title' from the image properties as a caption on the random photo. Does anyone have any good recommendation how to do this?

tommyh
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi tommyh,

Are you referring to this Random Image block?
https://www.concrete5.org/marketplace/addons/random-image1...
tommyh replied on at Permalink Reply
tommyh
Thanks for the reply. I was working with this one from jordanlev:
http://www.concrete5.org/marketplace/addons/random-image/...

Will this other one do the trick of showing the image title under the image?

I must also point out that this is a 5.6 site.
TMDesigns replied on at Permalink Reply
TMDesigns
$title = $f->getTitle()
echo $title;


I'd set up a new block override or theme then add this code above where you want it.

If you want help PM me and i can take a look
Steevb replied on at Permalink Reply
Steevb
A quick and dirty option.
Add following code to bottom of the view.php file and edit the image title in the image properties.
<div class="title"><?php  echo $img->title;?></div>

Then if needed style it from the view.css file.