Caption on images

Permalink
When using the Image block, there is a spot for "Alt/Caption" text. This adds alt text to the image, but a caption is nowhere in sight.

Is this simply a bad naming convention in the UI or am I missing something?

I tried adding this code to concrete/core/controllers/blocks/image.php:
$img .= "<p>{$this->altText}</p>";

on line 141, but that just hosed the page. :)
(I put the new file in the root level blocks directory)

CygnetMidwest
View Replies: View Best Answer
tallacman replied on at Permalink Best Answer Reply
tallacman
If you want an image caption block J12345 makes a good one in the marketplace for free. Called Image Caption I believe. The standard image block does not have a caption, just and alt tag.
CygnetMidwest replied on at Permalink Reply
CygnetMidwest
Excellent. I will look into that one.
cebabbage replied on at Permalink Reply
Hi, do you know of another version as the version suggested here is not compatible with 5.7.3.

Thanks
Dushka replied on at Permalink Reply
Dushka
I would have thought that the ability to add a caption to an image would be bog standard. Any developments in that direction? Anyone?
MrKDilkington replied on at Permalink Reply
MrKDilkington
@dushka

Are you looking for this feature for use in 5.7?
Dushka replied on at Permalink Reply
Dushka
@MrKDilkington
Yes I am.
I notice that the documentation for 5.7 Image block says that "The Alt. Text area is a short description that is useful for SEO and accessibility. Many templates also use it for a caption." This comment suggests that if I was a little bit more Cr5 savvy I could find a way of achieving the desired result, but I'm afraid I'm stumped. My apologies if I sound a tad peeved.
MrKDilkington replied on at Permalink Reply 2 Attachments
MrKDilkington
Here is a quick custom block template.

It should be unzipped into this directory:
application\blocks

This should be the path to the template after unzipping:
application\blocks\image\templates\caption\view.php
Dushka replied on at Permalink Reply
Dushka
O.K. Many thanks. Very much appreciated.