Skip to main content

Discourse installation

Discourse Testimonials with a Theme Component

Discourse keeps custom HTML out of posts and inside themes. An admin creates a small theme component, puts the StoryProof div and script in its HTML panes, and attaches it to the live theme. Because Discourse loads once and then swaps content in place, the result needs checking after a few clicks, not only on the first page view.

  • Which theme pane holds the div and which holds the script
  • The CSP setting to check if embed.js is refused
  • A plain link fallback that survives page swaps

Theme component code

Three pastes into one Discourse theme component

Type your widget id. The div goes in the pane that renders where you want the testimonials, usually the footer. The script goes in the closing body pane so it loads once. The third card is a plain link to keep in the same footer, for visitors who arrive after Discourse has swapped the page.

Shown in StoryProof when you copy a widget’s embed code.

Part 1 · Footer pane of your new component

Admin › Customize › Themes › Install › Create new › component › Edit CSS/HTML › Footer

<div data-storyproof-widget="YOUR_WIDGET_ID"></div>

Part 2 · Closing body pane of the same component

Same component › Edit CSS/HTML › </body>

<script src="https://app.storyproof.io/embed.js" async></script>

Part 3 · Footer pane, under the div

Same component › Edit CSS/HTML › Footer

<p class="sp-member-stories">
  <a href="[your StoryProof Wall of Love link]">Read what members say about us</a>
</p>

Save, add the component to your active theme, then load the forum in a private window. Click into a topic and back again: if the testimonials vanish after a click, the link underneath still points visitors to every story.

Your widget id is combined with the code here, in this tab only. Nothing is sent to Discourse or saved.

The problem, solved

Forum praise that nobody outside the thread sees

Discourse is good at holding conversations and not built to showcase them. These are the gaps admins describe and what the StoryProof side covers.

  • Problem 1

    The best feedback is buried in old topics

    A member writes a glowing reply in a support thread, it scrolls away, and a visitor deciding whether to join never finds it.

  • Problem 2

    There is no HTML block for posts

    Admins look for a place in the composer to paste embed code. Discourse’s documented home for custom HTML and scripts is a theme or theme component.

  • Problem 3

    Worried an outside script breaks the forum

    A theme change hits every member at once, and a bad snippet in the active theme is hard to back out while the site is misbehaving.

  • Problem 4

    I only want proof about the product

    A forum footer should not repeat off topic thanks or praise for a moderator; visitors want to hear what the product did for people.

  • Problem 5

    Widget missing after clicking between topics

    Discourse loads once and swaps content as people move around, and theme scripts are known to run on that first load only.

In StoryProof

Set it up in Discourse

All of this happens in the admin area, so it needs an account with admin rights on the forum.

Step 1 of 5

Prepare the widget in StoryProof

Create a widget for the forum, add the approved testimonials it should carry and pick a compact layout. A footer is short on height, so a strip or a single quote reads better than a full wall.

Where the code can sit in a Discourse theme

Theme panes are site wide. Pick by what you want every visitor to see on every page.

Showing the widget on a single page only needs a plugin outlet connector in theme JavaScript, which is developer work and outside this guide.
PaneWhat visitors seeTrade off
FooterTestimonials under every topic list and topicLow key and out of the way of reading; easy to miss
After HeaderTestimonials above the content on every pageHighly visible, but pushes every discussion down for regular members
Link only, no divA line of text pointing to the Wall of LoveNothing to fill or break; one click away from the proof

Before you start

Discourse specifics to know

  • Single page navigation

    Discourse loads once and swaps content in place, and theme scripts run on that initial load. StoryProof makes no claim that the widget refills after those swaps, which is why the page keeps a plain link beside it.

  • Content security policy

    Discourse adds a nonce to theme script tags and, since 3.3.0.beta1, uses strict-dynamic, so outside scripts usually load. If embed.js is still refused, an admin can add the StoryProof domain to the content_security_policy_script_src setting.

  • Site wide only, without code

    The theme panes render on every page. Limiting the widget to the forum home or one category needs custom theme JavaScript, which this guide does not cover.

  • No StoryProof plugin

    StoryProof has no Discourse plugin and does not sync with Discourse. Member praise reaches the widget through the collection link and your approval, not by importing topics.

  • Docs as of 2026-11-14

    The Discourse steps follow Meta guides and staff answers as read on 2026-11-14 and have not been tried on a live forum; admin labels move between releases. Widgets per workspace: Free 1, Starter 5, Pro unlimited. A small "Powered by StoryProof" badge shows until Pro.

FAQ

Questions people ask

Short answers to what usually comes up next.

Can I paste the embed straight into a topic instead?

The route Discourse documents for scripts is a theme or theme component, not the post composer. Use the component, and post the Wall of Love link in a topic if you also want it there.

Why does the widget show on the first page but not after I click a topic?

Discourse is a single page application: it loads once and replaces content as you move around, and scripts placed in a theme run on that first load. The plain link in the footer is there for exactly this case.

My theme is installed from a git repository. Should I edit it?

Discourse staff advise against editing an installed external theme directly because updates overwrite the change. A separate component attached to it keeps your code safe across theme updates.

Something broke after I saved. How do I get back in?

Visit /safe-mode on your forum to load it without the active theme and components, then detach or fix the StoryProof component.

Do I need the script once per widget?

No. One embed.js on the page fills every StoryProof div on it, so a second widget in another pane only needs its own div.

Still have a question? Ask the StoryProof team or book a demo.

Bring member praise out of the threads

Collect stories with one link, approve them, and add a small theme component to your forum.

Sources

  1. Beginner’s guide to using Discourse Themes, Discourse Meta. Checked 2026-11-14.
  2. Mitigate XSS attacks with Content Security Policy, Discourse Meta. Checked 2026-11-14.
  3. How do you force a script to refire on every page load in Discourse?, Discourse Meta. Checked 2026-11-14.
  4. What’s the fastest and easiest way to add a persistent javascript file or snippet, Discourse Meta. Checked 2026-11-14.

Last updated 2026-11-14.