Category Blog - make Intro Images clickable
It looks like $this->item->link is not returning the correct article URL, possibly because of how Joomla is handling links in your template.
Instead of $this->item->link, try using:
<a href="<?php echo JRoute::_($this->item->link); ?>">
<?php echo LayoutHelper::render('joomla.content.intro_image', $this->item); ?>
</a>
If the above still redirects to the homepage, replace $this->item->link with:
<a href="<?php echo $this->item->readmore_link; ?>">
<?php echo LayoutHelper::render('joomla.content.intro_image', $this->item); ?>
</a>
and clear cache for every single try
Thank you for your reply francus641. I have tried both of the suggestions but the Intro Image is still taking me to the website's homepage.
I'm trying to achieve the "Blog N/Sidebar" behaviour as seen in the JA Sport demo (https://www.joomlart.com/demo/ja-sport) under News > Blog n/ Sidebar where the Intro Images and Read More links take you to the article page.
Just to confirm, did you enable the feature you're looking for before doing these tests?
I imagine so, but in case you haven't checked:
In the back-end: Content > Articles >
on the top right side of the screen, click on [Options] >
on the "Blog/Featured Layouts" tab at the bottom "Linked Intro Image",
set it to "Yes".
Of course, if you haven't done so before doing these tests that I recommended, restore the file to its original conditions.
francus641, yes "Linked Intro Image" is toggled on.
Interestingly, I've just downloaded the JA Titan template and installed. Using the below default worked:
<?php echo LayoutHelper::render('joomla.content.intro_image', $this->item); ?>
I then tested with the Cassiopeia template and that works fine too.
I've no idea why the JA Sport template does not want to play ball!
Hi @pixel8er,
- First, restore all layout files to their original state.
- Next step open the intro.php file in the "ja_sport/html/layouts/joomla/content/image/" folder. Change the below code.
to$params = new Registry($item->attribs);
Save and reload your website to view the change.$params = $displayData->params;
If you don't override it, the next template update will lose all customization.
If there is ever a template update of course.
It seems to me that everything is going to pieces.
It's been almost a year since a new template has come out and we've been paying for a monthly template.
Is there anyone who can tell us once and for all what is happening to your company?
Hi,
I applied this code to the template package and It will not be lost if you update to a new version of the template.
Kind regards,
Thank you cssyeah.
Making the change in the intro.php file to the below worked:
$params = $displayData->params;
Many thanks for your assistance too @francus641.
Hi @pixel8er, @francus641.
No problem. I hope my customer support efforts will satisfy you.
Kind regards,