Would be great if we could set the default image style for youtube thumbnails so the output of its token could be handled/stylized. I can't find any issues on this subject...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

guschilds’s picture

This makes sense. I'd be happy to review and test any patches made for this functionality.

Thanks!

afi13’s picture

Assigned: Unassigned » afi13
afi13’s picture

I added patch, please review and test it.

afi13’s picture

Status: Active » Needs review
guschilds’s picture

Status: Needs review » Needs work

afi13,

Thank you for the patch, but I don't think it is what tregismoreira was asking for. The current patch defines a new image style that can't be changed without altering the module's code. I think they wanted an option on the configuration page that allowed them to choose an image style from a list of the image styles that already exist on their site (not a new one created by the module). Then, when the image is rendered through the token, it would be rendered with the image style selected in this setting. Then they could use an image style they've created that can be changed without changing this module's code.

Thanks again. Hope that helps!

afi13’s picture

Ok, no problem.

afi13’s picture

I am added new patch. Please review it. Patch created with git format-patch. So please use git am <patch-name> for save my metadata. Thanks.

afi13’s picture

Status: Needs work » Needs review
guschilds’s picture

Hey afi13,

Thanks for the second patch. I've attached a new patch with some changes. They include:

  • I made it clearer in the configuration option that this image style was for image URL token output. I did this by naming the option "Default token image style" and specifying the token's name in the option's description.
  • I added <none> (no image style) as the default option to the configuration setting.
  • Most importantly: I added to the existing youtube_image_url token rather than creating a new one. That token already existed to output an image's URL, so I extended it to output the URL of the image style derivative if an image style was selected in the configuration setting. I don't think we need to go farther to render it through an image tag. The end user can do that with the result of the token if they'd like. I believe this is what the original poster was asking for.

Please have a look and let me know what you think. Thanks!

afi13’s picture

Status: Needs review » Reviewed & tested by the community

It's ok for me.

guschilds’s picture

tregismoreira,

As you originally requested this, could you test the patch in #9?

I'd rather not commit added complexity to the module unless it is useful for others. If anyone else uses this, please leave a comment.

Thanks!

ighazali’s picture

Yes, this is a great feature! i used it and is working perfectly.
In my case i use meta-tags module and when sharing links to Facebook there was noway a user can tell if it was a video or something to read. This helps a lot.
Thanks

  • guschilds committed e9276e2 on 7.x-1.x
    Issue #2344145 by afi13, guschilds: Defined a default image style for...
guschilds’s picture

Title: Define a default image style for youtube thumbnail » Define a default image style for youtube thumbnail token
Assigned: afi13 » Unassigned
Status: Reviewed & tested by the community » Patch (to be ported)

Thanks for the feedback, ighazali! I have committed this to the 7.x-1.x branch and it will be a part of the next release. This feature now needs to be ported to the 8.x-1.x branch.

  • guschilds committed da457e0 on 8.x-1.x
    Issue #2344145 by guschilds: Defined a default image style for youtube...
guschilds’s picture

Status: Patch (to be ported) » Fixed

I have ported the feature and committed it to the 8.x-1.x branch. It will be a part of the next release. Closing this as Fixed. A big thanks to everyone who contributed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.