Image caption not showing

February 2014 Joomla Template
Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Mon Feb 08, 2016 8:25 pm
Reply with quote
Report this post
Hi

i would like to add image caption i have add this
Code: Select all
<p class="img_caption"> <?php echo htmlspecialchars($images->image_fulltext_caption) ?></p>
in html/com_content/article/default.php

like that
Code: Select all
<div class="img-fulltext-<?php echo $images->float_fulltext ? $images->float_fulltext : $params->get('float_fulltext'); ?>"> <img
                      <?php if ($images->image_fulltext_caption):
                         echo 'class="caption"'.' title="' .$images->image_fulltext_caption .'"';
                      endif; ?>
                   
                      <?php if (empty($images->float_fulltext)):?>
                         style="float:<?php echo  $params->get('float_fulltext') ?>"
                      <?php else: ?>
                         style="float:<?php echo  $images->float_fulltext ?>"
                      <?php endif; ?>
                      src="<?php echo $images->image_fulltext; ?>" alt="<?php echo $images->image_fulltext_alt; ?>" itemprop="image"/> <p class="caption"> <?php echo htmlspecialchars($images->image_fulltext_caption) ?></p></div>


and i add this in override.css
Code: Select all
p.img_caption {
    background-attachment: scroll;
    background-clip: border-box;
    background-color: #225587;
    background-image: none;
    background-origin: padding-box;
    background-position: 0 0;
    background-repeat: repeat;
    background-size: auto auto;
}
p.img_caption {
    color: #ffffff;
    font-size: 12px;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    padding-bottom: 5px;
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 5px;
    position: static;
    right: 0;
    top: 15px;
}


but nothing under my images : see there in action http://www.freenduro.com/news/hard-endu ... wade-young

could you help me ?
User avatar
Junior Boarder

GK User
Thu Feb 11, 2016 1:56 pm
Reply with quote
Report this post
no idea ?
User avatar
Junior Boarder

teitbite
Mon Feb 15, 2016 1:11 pm
Reply with quote
Report this post
Hi

Your code looks to be attached to img-fulltext which can be configured in article settings. What You are using is a regular image in article. I would use a small javascript to achieve what You want.

Code: Select all
<script type="text/javascript">(function($) {$(document).ready(function() {
$('img.caption').each(function(){
$(this).append('<p class="img_caption">'+$(this).attr('title')+'</p>');
});
});})(jQuery)</script>
User avatar
Moderator


cron