This seems to be useful as a foundation for more features to get more info from the link into Drupal.

For example, capturing the site title, or thumbnail from open graph tags?

Is it possible to take a screenshot of the page to use as a thumbnail?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

    Comments

    mortona2k created an issue. See original summary.

    d.fisher’s picture

    Version: 1.0.0 » 2.0.x-dev
    Priority: Normal » Minor
    d.fisher’s picture

    d.fisher’s picture

    I like this idea. The issue with relying on meta tags is that a lot of sites won't use them. I wonder if we could leverage Puppeteer to grab a screenshot of the webpage and save it as a file, but I believe this requires having node.js.

    Here's the documentation for when I come back to this:
    https://pptr.dev/guides/screenshots

    This isn't going to be straightforward but it's a really good idea that I'd definitely like to look into.

    mortona2k’s picture

    I think we would need to be able to run an extra service alongside drupal.

    Getting a POC that works in DDEV would be cool.

    d.fisher’s picture

    Had some discussions about this issue with others and the consensus is that this has the potential to drastically bloat what is quite a simple module and if pursued should almost certainly be implemented as an optional sub module that people can switch on if they desire the functionality. As an intermediate step could we perhaps add a field to the media entity 'link' that allows the upload of a custom thumbnail? The issue with this approach is that I don't want to overcomplicate any custom implementations that people are layering on after installation of the module.