Craft CMS installation
Craft CMS Testimonial Widget Embed
In Craft, the StoryProof embed belongs in your Twig templates, not pasted into a rich text field. Put the div in a small partial, register embed.js with Craft’s js tag so it is output at the end of the body, and let editors pick which widget an entry shows through a Plain Text field that holds the widget id. Templates stay in Git, editors never touch markup.
- A Twig partial with the div and the js tag
- An include driven by an editor field
- The layout check that makes registered scripts appear
Twig snippets
Twig for your Craft templates
Enter a widget id to use as the fallback. File 1 is the partial. File 2 shows the include in an entry template, using a field called storyproofWidgetId when an editor has filled it in. File 3 is the line your main layout needs before the closing body tag.
Part 1 · File 1: the partial
templates/_partials/storyproof-widget.twig
{# Renders one StoryProof widget. Pass widgetId when including. #}
<div data-storyproof-widget="{{ widgetId }}"></div>
{% js "https://app.storyproof.io/embed.js" with { async: true } %}Part 2 · File 2: include it from an entry template
templates/case-studies/_entry.twig (any template that extends your layout)
{% block content %}
{{ entry.body }}
{% include "_partials/storyproof-widget" with {
widgetId: entry.storyproofWidgetId ?: "YOUR_WIDGET_ID"
} %}
{% endblock %}Part 3 · File 3: the layout outputs registered scripts
templates/_layout.twig, just before </body>
{{ endBody() }}
</body>
</html>Load a page that uses the template and view its source. You should see the div where the include sits and the embed.js script tag near the end of the body.
The Twig is assembled in your browser. Nothing you type is stored.
The problem, solved
Craft testimonial chores, and the StoryProof way
- Problem 1
Editors paste script tags into Redactor
Raw code in a rich text or CKEditor field is easy to break and hard to spot in review.
How StoryProof solves it
Keep the StoryProof div and script in a Twig partial. Editors only type a widget id into a plain field, never markup.
- Problem 2
A testimonials channel nobody updates
A section of hand entered quotes needs someone to copy each new one in from email.
How StoryProof solves it
Customers submit to StoryProof, you approve them there, and you choose which approved ones each widget shows.
- Problem 3
Two widgets on a page, two script tags
Hard coding the script in every partial risks duplicate tags when a page includes the partial twice.
How StoryProof solves it
One embed.js load fills every StoryProof div on the page. If a template includes the partial twice, move the js tag up into the layout so it is registered once.
- Problem 4
Different praise for each service page
One generic carousel across the site wastes testimonials that speak to a specific service.
How StoryProof solves it
Tag testimonials in StoryProof (every plan has tags), build a widget per service, and set its id in that entry’s field.
- Problem 5
Client team and agency both need access
Sharing one login for the testimonial tool blurs who approved what.
How StoryProof solves it
Each StoryProof brand space has its own seats, with the number set by plan, so agency and client staff can sign in as themselves.
In StoryProof
Wire it into Craft
Step 1 of 4
Add the partial
Create templates/_partials/storyproof-widget.twig with File 1. Template paths in Craft are relative to the templates folder, so the include path drops the extension.
Step 2 of 4
Check the layout calls endBody()
Craft’s endBody() outputs scripts registered for the end body position and belongs just before the closing body tag. If your layout lacks it, add File 3.
Step 3 of 4
Give editors a widget field
Create a Plain Text field with the handle storyproofWidgetId and add it to the field layout of the entry types that may show testimonials. A blank field falls back to your default id.
Step 4 of 4
Include it and deploy
Add the include from File 2 to the entry template, commit, and deploy as usual. Fill the field on one entry and check its rendered source.
Before you start
Things the guide does not cover
Based on Craft 5 docs as of 2026-11-13
The js tag, endBody() and template paths follow Craft’s version 5 documentation read on 2026-11-13. The Twig has not been run on a live Craft site.
async on the js tag
Craft documents passing HTML attributes to the js tag and shows defer in its example. async is an ordinary attribute, but check the rendered tag carries it.
Static caching and CSP plugins
A static cache or a security plugin that sends a Content Security Policy can block or freeze the output. Allow app.storyproof.io in script-src if you use one.
No Craft plugin
StoryProof has no Craft plugin or field type. The field above is an ordinary Plain Text field holding an id.
Badge on lower plans
A small "Powered by StoryProof" badge sits under widgets until Pro.
FAQ
Questions people ask
Short answers to what usually comes up next.
Why not paste the embed into a rich text field?
Rich text editors may strip or rewrite script tags, and a code change then needs an editor rather than a commit. A partial keeps the markup in version control.
Does this work with a headless Craft front end?
Not as written. These snippets are for Craft rendering Twig itself. A separate front end would place the div and script in its own framework.
Can a Matrix block choose the widget?
Yes. Add the Plain Text field to a Matrix entry type and include the partial while looping over the blocks, passing that block’s value as widgetId.
What happens if two includes register the same script?
Check the page source. If you find two embed.js tags, move the js tag out of the partial and into the layout; one copy is all the page needs.
Still have a question? Ask the StoryProof team or book a demo.
Give your Craft editors live testimonials, not a quotes channel
Collect and approve in StoryProof, then render the widget from one Twig partial.
Sources
- Twig Tags (js, html), Craft CMS Documentation. Checked 2026-11-13.
- Twig Functions (head, beginBody, endBody), Craft CMS Documentation. Checked 2026-11-13.
- Twig fundamentals (extends, block, include), Craft CMS Documentation. Checked 2026-11-13.
- Templates, Craft CMS Documentation. Checked 2026-11-13.
- Plain Text Fields, Craft CMS Documentation. Checked 2026-11-13.
Last updated 2026-11-13.