Question

I find this com_content/views/article/tmpl/default.php I created a template override and here is the code:

    <?php if ($params->get('access-view')):?>
<?php if (isset($images->image_fulltext) && !empty($images->image_fulltext)) : ?>
<?php $imgfloat = (empty($images->float_fulltext)) ? $params->get('float_fulltext') : $images->float_fulltext; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"> 

<img
<?php if ($images->image_fulltext_caption):
    echo 'class="caption"'.' title="' .htmlspecialchars($images->image_fulltext_caption) . '"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_fulltext); ?>" alt="<?php echo htmlspecialchars($images->image_fulltext_alt); ?>"/> </div>
<?php endif; ?>

Before img tag how to form, modify this php code to be clickable the image to self url:

<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>"> <img
Was it helpful?

Solution

Here is the resolution:

<a href="<?php echo JURI::root().$images->image_fulltext; ?>">

Now the image is "clickalble" to self url

JURI::root() > your webpage url (like: something.com) $images->image_fulltext > in joomla 3.1 you can choose an image what is displayed when you click to readmore, ie when you read the full article, that image have an url, like: /images/stories/freshsite/something.jpg

This php code combines these two code, to be: something.com/images/stories/freshsite/something.jpg > when you click on the image, only this image will shows in you browser :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top