Step 1: Create a template and prepare it
First, create a template on the Rendless dashboard. You can create a template by clicking on the “Create template” button on the Templates page. Design your template with the desired elements and add dynamic variables using the{{variable}}
syntax to enable them to be replaced with custom data.
For more information, visit our guide on dynamic images with variables.

Template example, dynamic variables are marked with {{}}
{{title}}
, and the image URL is represented by {{image}}
. By default, the template will render with the static data unless you specify the dynamic values.
Step 2: Get the image generation URL
Once your template is ready, generate the image generation URL by clicking on the “Use Template” button, either from the template editor page or the template list page.
Example of the image generation URL
TEMPLATE_ID
with the actual ID of your template, and provide values for the variables via query parameters.
For example:
Step 3: Integrate the image generation URL in your PHP application
Now, integrate the image generation URL into your PHP application. You can do this by including the URL within theog:image
meta tag for Open Graph integration, which is commonly used in social media sharing.
For dynamic data, make use of PHP’s urlencode()
function to safely encode the values.
Here is an example of how you can add the dynamic og:image tag to your PHP application:
$pageTitle
and $imageURL
are PHP variables that contain the title and image URL, respectively. You can place this code inside the head section of your HTML output, dynamically generating og tags for each page.
You can place this code inside the head section of your HTML output, dynamically generating og
tags for each page.
Now, when your page is shared on social media, the dynamically generated image will be displayed using the title and image URL provided in the PHP variables.
You can see the image generated dynamically:

The image generated dynamically in PHP