Skip to main content

In crisis?Dial 988, then press 1Text 838255The Center 24/7: 620-792-2544 — Veterans should request support from our veteran crisis case manager.Emergency: 911

The Center for Counseling & Consultation

Staff workspace — preview

Wix embed kit

Place the Hub's interactive tools on The Center's Wix Studio pages. Wix keeps its own header, footer and page copy; the tool sits inside the page.

What changes inside a frame

The Hub's header and footer are hidden. The crisis bar always stays at the top. Links to other websites open in a new tab, and an “Open full view” link is always shown.

Frame height

Set the starting height below in Wix. Where Wix allows it, the frame then grows to fit; if not, it simply scrolls on its own. Automatic growing hasn't been tested on your Wix site yet.

Addresses

Use the planned veterans.thecentergb.org addresses once that address is connected. Until then, the test address works for trying things out.

Tools you can place on Wix

Test frame

This works like a Wix page: it shows Kansas Veteran Snapshot in a frame and grows it using the same height messages Wix would receive.

Waiting for height message…

Setting it up in Wix Studio

  1. Open the page in Wix Studio and add Embed & Social → Embed a Site (the HTML iframe element).
  2. Choose Website address and paste the tool's address from above.
  3. Stretch it to the full width of its section and set the starting height listed for that tool (desktop and mobile).
  4. In the Properties panel, set its ID to veteranHubFrame.
  5. For tools that grow to fit, turn on Dev Mode, open the page code panel and paste the code below. Tools that scroll inside the frame don't need it. Publish, then check on a phone.

Wix page code

// Veteran Hub frame — paste into this page's code panel in Wix Studio.
// Change "#veteranHubFrame" if you gave the HTML element a different ID.
const MIN_HEIGHT = 600;
const MAX_HEIGHT = 6000;

$w.onReady(function () {
  const hub = $w("#veteranHubFrame");

  hub.onMessage((event) => {
    const msg = event.data;
    // Only accept the Hub's own layout messages.
    if (!msg || msg.source !== "center-veteran-hub" || msg.version !== 1) return;

    if (msg.type === "HUB_SCROLL_TOP") {
      hub.scrollTo();
    }

    if (msg.type === "HUB_RESIZE" && typeof msg.height === "number") {
      // Some Wix layouts don't allow code to change an element's height.
      // If yours doesn't, the height you set in the editor is used, and
      // the frame scrolls on its own — nothing breaks.
      try {
        hub.height = Math.max(MIN_HEIGHT, Math.min(msg.height, MAX_HEIGHT));
      } catch (e) {}
    }
  });
});

Privacy & security

What the frame sends to Wix

Only its height, and a “scroll to top” signal when the visitor moves to a new page. Never searches, filter choices, answers, page names or anything typed. The Hub ignores messages from Wix.

Who can receive it

Exact approved addresses only — never “any site”:

  • https://www.thecentergb.org
  • https://thecentergb.org
  • https://editor.wix.com

Before going live, check

Visitor counts inside Wix frames may be counted separately from the full Hub, because browsers keep frame data apart. Reports will label these as estimates. Nothing is tracked until a provider is approved.