Skip to content

make intro image link to article#4134

Closed
modernmagic wants to merge 5 commits intojoomla:3.4-devfrom
modernmagic:patch-2
Closed

make intro image link to article#4134
modernmagic wants to merge 5 commits intojoomla:3.4-devfrom
modernmagic:patch-2

Conversation

@modernmagic
Copy link
Copy Markdown
Contributor

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.)

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.)
@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Aug 20, 2014

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.
So only link the image if the parameter to link the title is enabled and the user is allowed to see the full article.

@modernmagic
Copy link
Copy Markdown
Contributor Author

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.

@modernmagic modernmagic reopened this Aug 20, 2014
@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Aug 20, 2014

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.
You just need to make sure you select the correct branch (patch-2) in your forked repo. Or just use this link and click the edit button there: https://github.com/modernmagic/joomla-cms/blob/patch-2/layouts/joomla/content/intro_image.php 😄

If you need help, just ask. I'm happy to help.

added ($params->get('link_titles')
@ghost
Copy link
Copy Markdown

ghost commented Aug 21, 2014

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
XAMPP 3.2.1
Windows7 (virtualized)

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.

@wdburgdorf
Copy link
Copy Markdown

A couple of months ago I posted the same request:
http://issues.joomla.org/tracker/joomla-cms/3178

I also added a pull request:
https://github.com/lausianne/joomla-cms/commit/bdd6b41e480e6f85c621a668b040c49724f4cb1b#commitcomment-7485539

... but apparently it's not working anymore. If someone else is working on this now, I'll leave it alone.

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

@modernmagic
Copy link
Copy Markdown
Contributor Author

I am using this code in Joomla 3.3.3

What would need to be changed for 3.3.4 ?

@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Aug 24, 2014

Patch works fine for me.
However I see some codestyle issues I would like to have resolved first.
I'm going to add some notice to the diff so you see what I mean.

@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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to remove the grid_six class here. I guess that comes from your own template.

@ghost
Copy link
Copy Markdown

ghost commented Aug 24, 2014

@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.

@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Aug 24, 2014

The category should make no difference at all. It always uses the same layout. Maybe something is cached?

@ghost
Copy link
Copy Markdown

ghost commented Aug 24, 2014

DOH! Cleared cache and browser -- now works perfectly. Noob error.

@Bakual Bakual added the RTC label Aug 24, 2014
@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Aug 24, 2014

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
@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Aug 31, 2014

Merged into 3.4-dev branch. Thanks!

@Bakual Bakual closed this Aug 31, 2014
@modernmagic
Copy link
Copy Markdown
Contributor Author

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

@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Aug 31, 2014

Was that intended to be a separate PR or why do you think you messed it up? It looked fine to me.

@modernmagic
Copy link
Copy Markdown
Contributor Author

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. —
Jeff Mayland
modernmagic.com

On Sun, Aug 31, 2014 at 1:06 PM, Thomas Hunziker notifications@github.com
wrote:

Was that intended to be a separate PR or why do you think you messed it up? It looked fine to me.

Reply to this email directly or view it on GitHub:
#4134 (comment)

@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Sep 1, 2014

Looks all fine 👍

@ManuxGR
Copy link
Copy Markdown

ManuxGR commented Sep 10, 2014

It's working fine but when using caption text then the image in not more linked.

@modernmagic
Copy link
Copy Markdown
Contributor Author

ManuxGR, it works for me when I tested it using Article Manager: Edit Article / Images and links / Intro Image Caption
screen shot 2014-09-10 at 8 38 21 am

@ManuxGR
Copy link
Copy Markdown

ManuxGR commented Sep 11, 2014

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! :)

@zero-24 zero-24 removed the RTC This Pull Request is Ready To Commit label Oct 14, 2015
@laoneo laoneo mentioned this pull request Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants