transom / craft-behold
Behold.so Instagram feed integration for Craft CMS
Package info
github.com/transomdesign/craft-behold
Type:craft-plugin
pkg:composer/transom/craft-behold
Requires
- php: ^8.2
- craftcms/cms: ^5.0.0
This package is auto-updated.
Last update: 2026-04-20 08:12:38 UTC
README
Twig integration for Behold.so Instagram feeds. Fetches posts from a Behold feed URL and exposes them via craft.behold with built-in Craft cache support.
Requirements: Craft CMS 5, PHP 8.2+
Installation
The plugin is not yet published to Packagist. Install via a local path repository.
1. Add to your project's composer.json:
{
"repositories": [
{
"type": "path",
"url": "plugins/behold"
}
]
}
2. Require the package:
composer require transom/craft-behold
3. Enable the plugin in the Craft control panel under Settings → Plugins, or via the CLI:
php craft plugin/enable behold
Usage
Fetch posts
Pass your Behold feed URL to craft.behold.all(). Results are cached for 5 minutes per unique URL.
{% set posts = craft.behold.all('https://feeds.behold.so/YOUR_FEED_ID') %}
<ul>
{% for post in posts %}
<li>
{% tag 'img' with {
src: post.sizes.medium.mediaUrl,
width: post.sizes.medium.width,
height: post.sizes.medium.height,
alt: post.altText ?? post.caption,
} %}{% endtag %}
</li>
{% endfor %}
</ul>
Clear cache
{% do craft.behold.clearCache('https://feeds.behold.so/YOUR_FEED_ID') %}
Post object reference
Each item in the returned array is a BeholdPost with the following properties:
| Property | Type | Notes |
|---|---|---|
id |
string |
Instagram post ID |
timestamp |
string |
ISO 8601 publish date |
permalink |
string |
instagram.com/p/… link |
mediaType |
string |
IMAGE, VIDEO, or CAROUSEL_ALBUM |
isReel |
?bool |
true for Reels; null if not present |
mediaUrl |
string |
Original Instagram CDN URL |
thumbnailUrl |
?string |
Video thumbnail (VIDEO posts only) |
caption |
string |
Full caption including hashtags |
prunedCaption |
string |
Caption with hashtags and links stripped |
altText |
?string |
Instagram alt text, if set |
hashtags |
string[] |
Hashtags without the # |
mentions |
string[] |
Mentioned usernames without the @ |
colorPalette |
array |
See below |
children |
array |
Child posts for CAROUSEL_ALBUM |
sizes |
array |
Behold-hosted resized images (see below) |
sizes
Four sizes are available: small, medium, large, full. Each has:
post.sizes.medium.mediaUrl {# Behold CDN URL #} post.sizes.medium.width {# integer #} post.sizes.medium.height {# integer #}
colorPalette
Seven keys, each an RGB string ("R, G, B"):
dominant · muted · mutedLight · mutedDark · vibrant · vibrantLight · vibrantDark
<div style="background: rgb({{ post.colorPalette.dominant }})"></div>