Embed Custom Tactics

Bring more interactivity to your tactics. Embed your tactics and let users solve them.

You have full control over the tactics.

You can specify the position, what the right moves are and what the last move was.

Example

How to embed your own Tactics

On the page where you can create your own tactics is an embed button. This button will automatically creates the iframe code that you have to insert on your website.

  1. First you have to create your tactics with the tactic creator.
  2. After you have done this click on the button "Embed".
  3. Copy the iframe code and paste it into your page.

Use this link to create and embed your tactic: Create your own Tactic

Automation

This process can also be automated. All information needed for tactics are stored in the hash of the embed url.

To generate tactics automatically you can create this hash yourself.

The hash is the base64 encoded string which consists of the fen, the moves and the last move.

base64.encode("${fen};${moves};${last_move}")

The values are each separated by a ";". The moves must be in san notation and the last move in uci notation.

Implementation details

You can change the standard width and height if you wish. Just make sure that the height is about 80px higher than the width so that the "x to play" message fits under the board.

For mobile devices it is recommended to limit the width iframes to 100%. Below you will find the css to achieve that.

iframe { max-width: 100%; }