Skip to content
Developers · Embed

Embedding

One element names what to show; one script, loaded once per page, turns every such element into a widget. Each widget is an iframe from www.ocheso.com that sizes itself to its content, so it never scrolls inside your page.

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.

YoursiteSample

Weekly Blitz

Fri 19:003+2 blitzArena · 60 min
Join the tournament12 players in · free to enter
Standings
  1. 1Amina N.18404½
  2. 2Jean-Paul M.17924
  3. 3Chen L.17053½
  4. 4Fatou D.16883
Powered by Ocheso

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>
ViewShowsStarts at
tournamentThe event, joining, rounds, standings and games480px
joinThe entry card and button; once play starts, the player's own game220px
standingsThe table with tie-breaks360px
pairingsOne round's boards and results360px
bracketA knockout draw480px
liveGames in progress, when watchable560px
my-gameThe signed-in player's own game560px
scheduleAn organisation's live and upcoming events360px

What to show

Name exactly one of these on the element:

AttributeShows
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.
Weekly series are the easy way to keep a page current. Autopilot creates next week's event when this week's starts, and the widget moves to it on its own.

Attributes

All optional. Unknown or malformed values are ignored rather than guessed at, and nothing personal ever goes into a frame's address.

AttributeDefaultWhat it does
data-viewtournamentWhich view a tournament (or a series' current event) shows: tournament, join, standings, pairings, bracket, live, my-game.
data-langautoen 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-themeautoauto follows the visitor's system; light or dark fixes it.
data-accentyour brandA hex colour for buttons and highlights. Text on it is picked for 4.5:1 contrast.
data-radius12Corner radius in px, 0 to 24.
data-fontsystemsystem, inter, poppins, manrope or roboto. The named faces are served by Ocheso.
data-boardslateslate, wood, green, brand (tints of your accent) or contrast.
data-heightautoauto follows the content; fill takes the container's height; a number is fixed px.
data-min-heightper viewSpace held before the widget says how tall it is. See the view table.
data-lazytrueLoad when within 300px of the viewport. false loads at once.
data-titlethe event'sThe iframe's accessible title, for screen readers.
data-limitallRows in standings (1–500), for a sidebar top ten.
data-roundcurrentThe round pairings shows (1–999).
data-mobile-fullscreengameOn phones, games go full screen (game) or stay in place (never).
data-soundstruefalse keeps move sounds off. They start after the first tap anyway.
data-compactfalseTighter spacing for narrow columns.
data-headertruefalse 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:

HTML
<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.

HTML
<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 error event fires with code blocked.

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.