Jump to content

Image from template?


benbyf
 Share

Recommended Posts

Hi!

 

I was looking into automatically creating OpenGraph (OG) images from page assets and wondered if this would be possible in PW using a php image library and a template for the image??? Little out of my depth... But basically create an image template and process a page title and image on save into it, to then be saved as an image to that page.

Any thoughts would be great.

Link to comment
Share on other sites

Hi Ben,

This took me a bit to understand, but I think you're looking to generate an OpenGraph image similar to how GitHub's OG images appear to almost be an HTML page converted to an image? (At first I thought you just wanted to use a template to assign a specific page image and generate the meta text...) Chris Coyier at CSS-Tricks wrote up an overview of a couple different ways to produce something like this. His platform is WordPress using GD, but it could just as easily be applied to ProcessWire and IMagick. There are also services out there to help with this as well. See the comments for even more info.

https://css-tricks.com/auto-generated-social-media-images/

I'm in the middle of cleaning, patching/repairing walls, and repainting my guest room after a "friend" destroyed it on me, otherwise I'd offer to get a quick example going for you over the weekend. However, your needs are likely custom to your project and there are any number of various ways to produce this, so hopefully the overview linked will give you a good head start! 🙂

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...