Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Would be nice to have a live preview of the youtube player, for the user to know if his link works. Any hint where to start implementing that? Another option would be to do that using a live preview module...
Comments
Comment #2
guschilds CreditAttribution: guschilds at Chromatic commentedHey geraldito,
I don't know that this isn't common functionality for field types. I'm also not sure what you're referring to when you say "Another option would be to do that using a live preview module...". Could you provide more information there? There might be a contrib module that makes this easier, but I don't know of any. Users can always test the correctness of their video using core's Preview functionality (by clicking "Preview" next to the "Save" button on the node edit form). Is that not sufficient?
Thanks,
Gus
Comment #3
geraldito CreditAttribution: geraldito as a volunteer commentedHi Gus,
First thanks for your module and your answer. The instant feedback of a live preview is more a usability issue I want to offer my users, like the behavior of writing at Stackexchange for example.
I imagine an iframe just beside the field where youtube player and video is shown. Something like Page Preview does for the whole node.
(Another solution for me would be using a preview module and limit the preview to certain fields.)
Thanks,
Gerald
Comment #4
guschilds CreditAttribution: guschilds at Chromatic commentedHey Gerald,
If you could find a preview module that works as needed, that would be the easiest approach. If you were trying to write a patch for the module that accomplished this behavior, I would probably suggest something like the following:
hook_menu()
to define a new menu item. It's URL should have a wildcard (%
) that accepts an encoded YouTube video URL (if that's possible, if not, perhaps pass it as a query parameter) and passes it along to the menu callback.I hope that helps. We've always tried to keep this module as simple as possible, and the above process is a decent amount of complexity, so I don't know that this would ever make it into the module. That said, I'm happy to review any patches you come up with and provide any feedback if you're stuck.
Gus
Comment #5
geraldito CreditAttribution: geraldito as a volunteer commentedHi Gus,
That's a great step by step guide to accomplish what I need. I'll try to implement it and get back to you for feedback.
Thanks for your great help
Gerald
Comment #6
guschilds CreditAttribution: guschilds commentedClosing due to 2.5 years of inactivity and a lack of patches/interest.