Is there any possibility to insert an image caption for the image featured in article blog options?
Thanks
blog option feature image caption
Accepted answer
Marked as the solutionHi Renzo,
I was able to figure out a way to add captions to my images. Hope this helps.
You'll need to add some code to this file; templates/your_template_name/html/com_content/articles/default.php
Around line 118 (may be different on your template) you'll see this line (had to remove the open and closing php tags, be sure to add them back):
echo LayoutHelper::render('joomla.content.full_image', $this->item);
Just below it add this:
if ($images->image_fulltext_caption) : echo '<div class="captions"><span class="image-caption">' . htmlspecialchars($images->image_fulltext_caption) . '</span></div>'; endif;
For it to appear you'll need to add your caption in the Full Image caption field under Images and Links of the Joomla article.
I also added the following CSS to style it up a bit:
.article-details .article-full-image {
text-align: center;
margin-bottom: 1rem;
}
.captions {
margin-bottom: 20px;
}
span.image-caption {
border-left: 3px solid #4392f1;
padding: 0px 0px 0px 8px;
font-style: italic;
}
P.S. Joomshaper, you should really stop removing core article functionality from Joomla Articles. There should be an ALT field and Caption field under the Blog Option images.
Kind regards,
John
2 more replies
Hi there!
Thanks for your query.
I am sorry to say that, there is no default way to have that as per my knowledge.
Best Regards
I'm looking for the same thing, for the life of me, I cannot understand why Joomshaper eliminated the default Joomla Article image for full view and the image caption.
There has got to be a way to add them.