Category Blog Page - Article Image doenst Link to article.

Feel free to talk about everything related to our Joomla Products
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Thu Jul 03, 2014 5:39 am
Hi Guys,


The site haves a menu with links that are in the majority just a listing of articles using "category blog" view. to show the services.
Example: http://dev.josinaldomartins.com.br/index.php/estetica

Shouldn't this images on be clicable and send the user to the article?
The read more and title link work as expected but the images seem not to hold any link....


Best Regards,
Paulo
User avatar
Expert Boarder

GK User
Thu Jul 03, 2014 6:54 am
By default in Joomla this images are just not clickable. Please try to use Search - we've provided solution how to modify this view. You can also use K2 where the image is by default link to article page.
User avatar
Platinum Boarder

GK User
Thu Jul 03, 2014 11:14 pm
bkrztuk wrote:By default in Joomla this images are just not clickable. Please try to use Search - we've provided solution how to modify this view. You can also use K2 where the image is by default link to article page.



Are you referring to?:
https://www.gavick.com/forums/simplicit ... nk#p185010


The guy never got it to work, he had to switch to K2.
By the way th blog_item.php code you show there looks different on my Joomla.
The only reference to images i see on my blog_item.php is;

<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>


Here is a link to the website.
http://dev.josinaldomartins.com.br/index.php/face

Thanks for helping out.


Best Regards
User avatar
Expert Boarder

GK User
Fri Jul 04, 2014 1:57 pm
Depends of the template the code may be different - do you use Joomla 2.5 or 3.x version?
User avatar
Platinum Boarder

GK User
Fri Jul 04, 2014 2:23 pm
I am using joomla 3
The joomla template is gk simplicity
User avatar
Expert Boarder

GK User
Mon Jul 07, 2014 8:16 am
Please open file template/html/com_content/category/blog_item.php and find this part of code:

Code: Select all
<img
         <?php if ($images->image_intro_caption):
            echo 'class="caption"'.' title="' .$images->image_intro_caption .'"';
         endif; ?>
         <?php if (!empty($images->image_intro)):?>
            style="float:<?php echo  $params->get('float_intro') ?>"
         <?php else: ?>
            style="float:<?php echo  $images->float_intro ?>"
         <?php endif; ?>
         src="<?php echo $images->image_intro; ?>" alt="<?php echo $images->image_intro_alt; ?>"/>


and replace it with:

Code: Select all
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
      <img
         <?php if ($images->image_intro_caption):
            echo 'class="caption"'.' title="' .$images->image_intro_caption .'"';
         endif; ?>
         <?php if (!empty($images->image_intro)):?>
            style="float:<?php echo  $params->get('float_intro') ?>"
         <?php else: ?>
            style="float:<?php echo  $images->float_intro ?>"
         <?php endif; ?>
         src="<?php echo $images->image_intro; ?>" alt="<?php echo $images->image_intro_alt; ?>"/></a>
User avatar
Platinum Boarder

GK User
Mon Jul 14, 2014 5:28 am
bkrztuk wrote:Please open file template/html/com_content/category/blog_item.php and find this part of code:

Code: Select all
<img
         <?php if ($images->image_intro_caption):
            echo 'class="caption"'.' title="' .$images->image_intro_caption .'"';
         endif; ?>
         <?php if (!empty($images->image_intro)):?>
            style="float:<?php echo  $params->get('float_intro') ?>"
         <?php else: ?>
            style="float:<?php echo  $images->float_intro ?>"
         <?php endif; ?>
         src="<?php echo $images->image_intro; ?>" alt="<?php echo $images->image_intro_alt; ?>"/>


and replace it with:

Code: Select all
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
      <img
         <?php if ($images->image_intro_caption):
            echo 'class="caption"'.' title="' .$images->image_intro_caption .'"';
         endif; ?>
         <?php if (!empty($images->image_intro)):?>
            style="float:<?php echo  $params->get('float_intro') ?>"
         <?php else: ?>
            style="float:<?php echo  $images->float_intro ?>"
         <?php endif; ?>
         src="<?php echo $images->image_intro; ?>" alt="<?php echo $images->image_intro_alt; ?>"/></a>


I cant find that code on my end :(
The only reference i have on image is this;

<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>

The lines around it are;
<?php if ($useDefList) : ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?>
<?php endif; ?>

<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>


<?php if (!$params->get('show_intro')) : ?>
<?php echo $this->item->event->afterDisplayTitle; ?>
<?php endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?> <?php echo $this->item->introtext; ?>
User avatar
Expert Boarder

GK User
Mon Jul 14, 2014 10:50 am
Are you sure that the issue happen on category page or maybe featured articles page? I've checked the code on simplicity template, this is the one that you use?
User avatar
Platinum Boarder

GK User
Mon Jul 14, 2014 12:31 pm
bkrztuk wrote:Are you sure that the issue happen on category page or maybe featured articles page? I've checked the code on simplicity template, this is the one that you use?


I use simplicity template but copied to blog_item the code on university template
User avatar
Expert Boarder

GK User
Tue Jul 15, 2014 2:18 pm
I've provided you solution for simplicity because there was nowhere word about university view. Solution is exactly the same, you need to wrap <img> tag with the link (<a>)
User avatar
Platinum Boarder

GK User
Tue Jul 22, 2014 4:31 am
bkrztuk wrote:I've provided you solution for simplicity because there was nowhere word about university view. Solution is exactly the same, you need to wrap <img> tag with the link (<a>)


But how...? the code you told me to lookup isnt there, so i can´t wrap it....
User avatar
Expert Boarder

GK User
Tue Jul 22, 2014 10:54 am
Please tell me which template you use - simplicity or university? I'm unable to prepare a solution for your custom changes without seeing your code so please tell me for what product should I prepare solution.
User avatar
Platinum Boarder

GK User
Tue Jul 22, 2014 3:46 pm
bkrztuk wrote:Please tell me which template you use - simplicity or university? I'm unable to prepare a solution for your custom changes without seeing your code so please tell me for what product should I prepare solution.



I am using the template simplicity but replaced the content article view with the code in university.
(i wantd to get rid of those links on the left of the article that are used in simplicity)
User avatar
Expert Boarder

GK User
Mon Jul 28, 2014 1:27 pm
But the article view is not the file responsible of the blog view.
content article view
. Please provide me name of the file which you've changed because again I will provide you solution which will not work in your installation.
User avatar
Platinum Boarder

GK User
Sun Aug 10, 2014 12:54 am
bkrztuk wrote:But the article view is not the file responsible of the blog view.
content article view
. Please provide me name of the file which you've changed because again I will provide you solution which will not work in your installation.



The file name is
blog_item.php
User avatar
Expert Boarder

GK User
Mon Aug 11, 2014 10:55 am
I think that we really misunderstand somewhere. I've opened University template blog_item file and there the image is link to article :

Code: Select all
      <?php  if (isset($images->image_intro) and !empty($images->image_intro)) : ?>
      <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); ?>" class="img-intro-<?php echo $images->float_intro ? $images->float_intro : $params->get('float_intro'); ?>">
         <img
            <?php if ($images->image_intro_caption):
               echo 'class="caption"'.' title="' .$images->image_intro_caption .'"';
            endif; ?>
            <?php if (!empty($images->image_intro)):?>
               style="float:<?php echo  $params->get('float_intro') ?>"
            <?php else: ?>
               style="float:<?php echo  $images->float_intro ?>"
            <?php endif; ?>
            src="<?php echo $images->image_intro; ?>" alt="<?php echo $images->image_intro_alt; ?>"/>
      </a>
      <?php endif; ?>


Exactly the same you may see on demo of University template where clicking on image redirect you to article » Category blog

So what you want to modify here if the image is already a link?
User avatar
Platinum Boarder


cron