User tests: Successful: Unsuccessful:
I believe that it should either be an option or always setup that the image also links to the article just like the title and readmore.
(This is my first try at contributing to Joomla. Please tell help me if I am doing this wrong. I am not a coder, but was able to get this to work for my client's site by copy/pasting similar code.)
Status | Pending | ⇒ | New |
Labels |
Added:
?
?
|
The easiest thing is to override the layout in your template to achieve this.
The JLayoutHelper::render('joomla.content.intro_image', $this->item)
part does load a JLayout located at layouts/joomla/content/intro_image.php
. Just copy that file to you template folder using the same structure templates/your_template/html/layouts/joomla/content/intro_image.php
and add the link there.
This will link the images without the need for yet another option and without the need of editing core files.
In the layout override you the use $displayData
instead of $this->item
.
Like <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($displayData->slug, $displayData->catid)); ?>">
I don't think this is something which needs to be part of the core itself as it's more a question of the template how it should work. But I'm open for other opinions. This topic wasn't raised the first time
Just noted that you did this PR against the 3.2.x
branch. The 3.2.x
branch doesn't accept regular PRs like this anymore (only security fixes are accepted).
I'm going to close this PR because of this. Feel free to open a new one for the staging
branch instead.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-08-19 19:42:11 |
You have to make the changes here: /layouts/joomla/content/intro_image.php
Right now what you did will not reflect if a template uses layouts, so revert the changes here and do it in the layout