Embedding
Views
A tournament can be shown whole or in parts. Use the whole view unless your page has a reason not to: it covers joining, the rounds, the table and the games, and switches between them by itself.
Everything: the event, joining, rounds, standings and games. The one to start with. Starts at 480px.
Weekly Blitz
- 1Amina N.18404½
- 2Jean-Paul M.17924
- 3Chen L.17053½
- 4Fatou D.16883
A drawing of this view. The live demo isn't available right now.
<div data-ocheso-tournament="weekly-blitz" data-view="tournament" data-theme="auto" data-lang="auto">
<a href="https://www.ocheso.com/o/yoursite/weekly-blitz">Weekly Blitz</a>
</div>
<script async src="https://www.ocheso.com/embed/v1.js"></script>| View | Shows | Starts at |
|---|---|---|
| tournament | The event, joining, rounds, standings and games | 480px |
| join | The entry card and button; once play starts, the player's own game | 220px |
| standings | The table with tie-breaks | 360px |
| pairings | One round's boards and results | 360px |
| bracket | A knockout draw | 480px |
| live | Games in progress, when watchable | 560px |
| my-game | The signed-in player's own game | 560px |
| schedule | An organisation's live and upcoming events | 360px |
What to show
Name exactly one of these on the element:
| Attribute | Shows |
|---|---|
| data-ocheso-tournament="weekly-blitz" | One tournament, in the view data-view names. |
| data-ocheso-org="yoursite" | Your schedule: what's live and what's next. |
| data-ocheso-series="yoursite/friday-blitz" | A weekly series: always this week's event, live or next. Paste it once and it never goes stale. |
| data-ocheso-game="<game id>" | A single game, to watch. |
Attributes
All optional. Unknown or malformed values are ignored rather than guessed at, and nothing personal ever goes into a frame's address.
| Attribute | Default | What it does |
|---|---|---|
| data-view | tournament | Which view a tournament (or a series' current event) shows: tournament, join, standings, pairings, bracket, live, my-game. |
| data-lang | auto | en or fr; auto follows your page's <html lang>, then the visitor's browser. A plain iframe takes English unless its address says /embed/fr/. Hosted pages and emails follow the tournament's own language. |
| data-theme | auto | auto follows the visitor's system; light or dark fixes it. |
| data-accent | your brand | A hex colour for buttons and highlights. Text on it is picked for 4.5:1 contrast. |
| data-radius | 12 | Corner radius in px, 0 to 24. |
| data-font | system | system, inter, poppins, manrope or roboto. The named faces are served by Ocheso. |
| data-board | slate | slate, wood, green, brand (tints of your accent) or contrast. |
| data-height | auto | auto follows the content; fill takes the container's height; a number is fixed px. |
| data-min-height | per view | Space held before the widget says how tall it is. See the view table. |
| data-lazy | true | Load when within 300px of the viewport. false loads at once. |
| data-title | the event's | The iframe's accessible title, for screen readers. |
| data-limit | all | Rows in standings (1–500), for a sidebar top ten. |
| data-round | current | The round pairings shows (1–999). |
| data-mobile-fullscreen | game | On phones, games go full screen (game) or stay in place (never). |
| data-sounds | true | false keeps move sounds off. They start after the first tap anyway. |
| data-compact | false | Tighter spacing for narrow columns. |
| data-header | true | false hides the event's title bar, when your page already has one. |
A standings table for a sidebar, top ten, compact, without the title bar:
<div data-ocheso-tournament="weekly-blitz" data-view="standings" data-theme="auto" data-lang="auto" data-limit="10" data-compact="true" data-header="false">
<a href="https://www.ocheso.com/o/yoursite/weekly-blitz">Weekly Blitz</a>
</div>
<script async src="https://www.ocheso.com/embed/v1.js"></script>Install methods
Script (recommended)
The element and the loader, as above. The loader watches the page, so widgets added later (a client-side route, a tab that renders on click) mount by themselves and unmount when they're removed.
iframe
For site builders that only take an iframe. It works on its own at the height you give it. If the loader is also on the page, it adopts the iframe and makes it follow its content.
<iframe data-ocheso-frame src="https://www.ocheso.com/embed/en/t/weekly-blitz" title="Weekly Blitz"
style="width:100%;min-height:480px;border:0" loading="lazy"
allow="fullscreen; autoplay; clipboard-write; web-share" referrerpolicy="origin"></iframe>React and Next.js
Render the element, and add the script once. The loader keeps up with React adding and removing elements, so there is nothing to clean up on route changes. For full control use Ocheso.mount() instead; see Events & JS API.
WordPress
Add a Custom HTML block where the widget should go, paste the script snippet, and update the page. Page builders (Elementor, Divi) have an equivalent HTML element. No plugin to install.
Link
Every tournament has a hosted page at /o/{org}/{slug} with your logo and colours, in English and French, and a branded preview card when it is shared.
Sizing and loading
- The widget takes the full width of its container and follows its content's height, up to 20,000px. Put it in a narrower column to make it narrower.
- Until the frame reports its height it holds the view's starting height, so the page doesn't jump. Override it with
data-min-height. - Frames load when they come within 300px of the viewport. A widget far down a long page costs nothing until someone scrolls to it.
- If the frame doesn't answer within 10 seconds (a strict security policy, an ad blocker, no network), the link you put inside the element shows instead and an
errorevent fires with codeblocked.
On phones
Widgets are built for small screens first and work from 320px wide. When a player's game starts on a phone, it goes full screen: the browser's own full screen where it has one, otherwise the widget covers the page and the Back button brings the page back. Turn this off with data-mobile-fullscreen="never". Inside your own app, see Mobile apps.