make intro image link to article#4134
make intro image link to article#4134modernmagic wants to merge 5 commits intojoomla:3.4-devfrom modernmagic:patch-2
Conversation
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. In the blog layout I watch my clients always rolling over the intro image first to click on it to see the full article. I do this to all my sites as it seems to be a better UX. (This is my 2nd :-) 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.)
|
If we want to add this, I guess the logic for the link should match the one used for the title. Similar to what is done in the JLayout for the blog title: https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/content/blog_style_default_item_title.php#L23. |
|
Agreed. I have edited the code in my environment, but due to lack of github experience I don't know what to do next. Please help so I can paste in the new edits. |
|
If you're using the GitHub UI, then you can edit the file again in your browser and do the changes. This pull request will be updated with the changes then. If you need help, just ask. I'm happy to help. |
added ($params->get('link_titles')
|
After applying patch (patchtester), intro image still was not linked. Tried cutting and pasting the code directly from https://github.com/modernmagic/joomla-cms/blob/patch-2/layouts/joomla/content/intro_image.php into layouts/joomla/content/intro_image.php with no success either. Joomla 3.3.4dev This is the first time I've done this in a while, so I feel pretty new at this. Please let me know if there is anything else needed. |
|
A couple of months ago I posted the same request: I also added a pull request: ... but apparently it's not working anymore. If someone else is working on this now, I'll leave it alone. |
|
I am using this code in Joomla 3.3.3 What would need to be changed for 3.3.4 ? |
|
Patch works fine for me. @sonkoral On which page did you try this? I used a blog menu item where it worked. There may be other layouts which don't use the JLayout to show the intro_image. There it would not work. |
There was a problem hiding this comment.
You have to remove the grid_six class here. I guess that comes from your own template.
|
@Bakual - It works for the "uncategorized" default category, but not for my newly created category "blog" on localhost... I have placed the code in layouts/joomla/content/intro_image.php as stated previously. |
|
The category should make no difference at all. It always uses the same layout. Maybe something is cached? |
|
DOH! Cleared cache and browser -- now works perfectly. Noob error. |
|
Marked RTC as we have two good tests. |
Same rational as #4134 I see users try and click on the images in this tag view. So I have duplicated the href from the $item->core_title to the $images->image_intro
|
Merged into |
|
Thomas, I must have messed up with the similar commit I made for the intro images in the tag layout. Can you help fix that commit too? f1f29ad |
|
Was that intended to be a separate PR or why do you think you messed it up? It looked fine to me. |
|
Since there was no activity and I titled it the same, I thought it might have been skipped over. Again, I'm new to github so I'm not sure I did it right. — On Sun, Aug 31, 2014 at 1:06 PM, Thomas Hunziker notifications@github.com
|
|
Looks all fine 👍 |
|
It's working fine but when using caption text then the image in not more linked. |
|
Hey modernmagic, thanks for the quick reply. It doesn't work for joomla 3.3.1. I had to updated to 3.3.3, and now everything works, and with caption text also! :) |

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. In the blog layout I watch my clients always rolling over the intro image first to click on it to see the full article. I do this to all my sites as it seems to be a better UX.
(This is my 2nd :-) 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.)