Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • cesio131 Friend
    #881910

    Hello,

    I have a problem about the possibility of making the image link to the home page next to the image attached. I would like the link, in addition to the link text, is also available on the image:

    Tnx
    Francesco


    1. link_img
    Ninja Lead Moderator
    #883129

    Hi,

    You can try this:

    Open templates/ja_medicare/html/layouts/joomla/content/intro_image.php file

    find and change

    <div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"> <img
        <?php if ($images->image_intro_caption):
            echo 'class="caption"' . ' title="' . htmlspecialchars($images->image_intro_caption) . '"';
        endif; ?>
        src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>" itemprop="thumbnailUrl"/> </div>

    to

    <div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"><a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($displayData->slug, $displayData->catid)); ?>" itemprop="url"><img
        <?php if ($images->image_intro_caption):
            echo 'class="caption"' . ' title="' . htmlspecialchars($images->image_intro_caption) . '"';
        endif; ?>
        src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>" itemprop="thumbnailUrl"/></a> </div>

    Regards


    1. Screen-Shot-2016-02-17-at-12.03.24
    cesio131 Friend
    #884317

    Unfortunately in my template I do not know where to make the change

    <div class="row">
            <?php $images  = json_decode($this->item->images); ?>
    
            <div class="<?php if (isset($images->image_intro) && !empty($images->image_intro)) : echo 'col-sm-4'; else: echo 'col-sm-1'; endif; ?> article-image-wrap">
                <?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
    
                <?php if ($params->get('show_publish_date')) : ?>
                    <?php echo JLayoutHelper::render('joomla.content.info_block.publish_date_blog2', array('item' => $this->item, 'params' => $params)); ?>
                <?php endif; ?>
            </div>
    
            <div class="<?php if (isset($images->image_intro) && !empty($images->image_intro)) : echo 'col-sm-8'; else: echo 'col-sm-11'; endif; ?>  article-content-wrap">
    
            <?php if ($params->get('show_title')) : ?>
                <header class="article-header clearfix">
                    <h2 class="article-title" itemprop="name">
                        <?php if ($params->get('link_titles') && $params->get('access-view')) : ?>
                            <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>" itemprop="url"> <?php echo $this->escape($this->item->title); ?></a>
                        <?php else : ?>
                            <?php echo $this->escape($this->item->title); ?>
                        <?php endif; ?>
                    </h2>
                </header>
            <?php endif; ?>
    Ninja Lead Moderator
    #884955

    I have updated the solution from here, you can apply it on your site.

    cesio131 Friend
    #886879

    Thanks for the answer, but the problem is not in the category of images, but featured in the form found on the home page. I applied your code and I solved a problem, but not what I’m looking for.

    Try to see here

    For example: on the green image Trico Vitlity, the link is over only the text and NOT on the image. In the module isn’t possible setting this.

    Tnx
    Francesco

    Ninja Lead Moderator
    #888194

    🙁 that’s mod_articles_category module and you can use this way

    Open templates/ja_medicare/html/mod_articles_category/five-columns.php file

    find and change

    <img
        <?php if ($images->image_intro_caption):
            echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
        endif; ?>
        src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/>

    to

    <a class="mod-articles-category-title <?php echo $item->active; ?>" href="<?php echo $item->link; ?>"><img
        <?php if ($images->image_intro_caption):
            echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
        endif; ?>
        src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/></a>

    Hope it helps

    cesio131 Friend
    #888556

    Thank you so much for your support, I would never find a way to fix this. Now everything works correctly.

    TNX
    Francesco

Viewing 7 posts - 1 through 7 (of 7 total)

This topic contains 6 replies, has 2 voices, and was last updated by  cesio131 8 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum