The .contentType parameter lets you change how a parameterized element is rendered at runtime — without modifying the template itself. For example, you can render a text element as an image, or an image element as plain text.
This is useful when a template layout has an element in the right position and size, but you need it to display a different type of content for a specific render.
When you add .contentType to a parameterized element, Orshot changes the rendering mode for that element:
The element keeps its original position, dimensions, and applicable styles — only the rendering behavior changes.
parameterID.contentTypeFor multi-page templates:
pageN@parameterID.contentType| Value | Description | Applicable To |
|---|---|---|
"image" | Render the element as an image | Text elements |
"text" | Render the element as text | Image elements |
Render a text element as an image by setting .contentType to "image" and passing an image URL as the element's value:
{
"modifications": {
"title": "https://example.com/logo.png",
"title.contentType": "image"
}
}The title text element now displays the provided image instead of text.
You can combine .contentType with style properties that apply to images:
{
"modifications": {
"title": "https://example.com/photo.jpg",
"title.contentType": "image",
"title.objectFit": "cover",
"title.borderRadius": "12px"
}
}{
"modifications": {
"page1@badge": "https://example.com/badge-gold.png",
"page1@badge.contentType": "image",
"page2@badge": "https://example.com/badge-silver.png",
"page2@badge.contentType": "image"
}
}Render an image element as text by setting .contentType to "text" and passing text content as the element's value:
{
"modifications": {
"avatar": "Coming Soon",
"avatar.contentType": "text"
}
}The avatar image element now displays "Coming Soon" as text instead of an image.
You can apply text style properties when rendering an image element as text:
{
"modifications": {
"photo": "No Image Available",
"photo.contentType": "text",
"photo.fontSize": "24px",
"photo.color": "#999999",
"photo.textAlign": "center"
}
}Use .contentType together with .prompt for AI-generated content in a different format:
{
"modifications": {
"textSlot.contentType": "image",
"textSlot.prompt": "A minimalist logo for a coffee shop, flat design"
}
}{
"modifications": {
"label": "https://example.com/icon.svg",
"label.contentType": "image",
"label.href": "https://example.com"
},
"response": {
"format": "pdf"
}
}Orshot validates .contentType values and will skip invalid entries:
"image" or "text" (case-insensitive).contentType to the same type as the element (e.g., "image" on an image element) is ignored since it has no effect.contentType is not supported on shape or video elementsIf validation fails, the element renders normally with its original type.
A template with a text element for a label — sometimes show an icon image instead:
{
"modifications": {
"badge": "https://cdn.example.com/verified-badge.png",
"badge.contentType": "image",
"badge.objectFit": "contain"
}
}Or keep it as text:
{
"modifications": {
"badge": "VERIFIED"
}
}An image element that shows text when no image is available:
{
"modifications": {
"product_image": "Image not available",
"product_image.contentType": "text",
"product_image.fontSize": "18px",
"product_image.color": "#aaaaaa",
"product_image.textAlign": "center"
}
}Use a single template layout where a text element can optionally display a user's avatar:
{
"modifications": {
"user_label": "https://example.com/avatars/user123.jpg",
"user_label.contentType": "image",
"user_label.borderRadius": "50%",
"user_label.objectFit": "cover",
"username": "@johndoe"
}
}curl -X POST https://api.orshot.com/v1/studio/render \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "your-template-id",
"modifications": {
"slot": "https://example.com/image.png",
"slot.contentType": "image",
"slot.objectFit": "contain"
},
"response": {
"format": "png",
"type": "url"
}
}'https://api.orshot.com/v1/studio/dynamic-url/my-template?
slot=https%3A%2F%2Fexample.com%2Fimage.png&
slot.contentType=image&
slot.objectFit=contain.contentType. Shape and video elements are not supported..contentType to the element's own type is a no-op and will be ignored.fontSize won't affect an element rendered as an image.