How to link Joomla intro Image on template override

9 years 6 months ago #250134 by itish
How to link Joomla intro Image to fulltext instead of having readmore link on template override. Please Help I have tried various ways and nothing works.

Option 1 (not sexy):
Edit /components/com_content/views/featured/tmpl/default_item.php
Change line 135-140:
Change this:
Code:
<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 this:
Code:
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>"><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>


Option 2 (recommended):
Use template override, do the same thing as in option 1 and add title to link (for seo).

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.702 seconds

Facebook Twitter LinkedIn