Creator Docs

Fragment

A fragment is a layout that you put inside other layouts. Use it for parts that many layouts share, such as a row of buttons.

When you change the fragment, every layout that uses it changes too.

The layout editor on a phone with the Main Menu layout. The Back Button fragment is selected. On the canvas, it shows its picture in the top left corner. Its settings show Back Button under Fragment. The layout editor on desktop with the Main Menu layout. The Back Button fragment is selected. On the canvas, it shows its picture in the top left corner. Its settings show Back Button under Fragment.

This example makes a fragment called Back Button, with one picture in it. Then it puts the fragment in a layout called Main Menu.

Make a fragment

A fragment is a layout with Can Be Used As Fragment set to Yes.

  1. Open the Layouts page. See Open the Layouts page.

  2. Next to the Default folder, tap Add. The Add Layout box opens.

  3. Under Layout Name, type a name, such as Back Button.

  4. Under Layout Type, choose General.

  5. Under Can Be Used As Fragment, tap Yes.

    The Add Layout box on a phone. Back Button is typed under Layout Name, and General is chosen under Layout Type. Under Can Be Used As Fragment, Yes is chosen. Layout Name, Can Be Used As Fragment, and the Add Layout button are marked. The Add Layout box on desktop. Back Button is typed under Layout Name, and General is chosen under Layout Type. Under Can Be Used As Fragment, Yes is chosen. Layout Name, Can Be Used As Fragment, and the Add Layout button are marked.
  6. Tap Add Layout.

  7. Open the new layout. Add the elements that you want to share. This example adds an image with the picture box-1. See Image.

To make a layout that you already have into a fragment, open its edit box. See Edit an item. Under Can Be Used As Fragment, tap Yes. Then tap Save.

Put the fragment in a layout

  1. Open another layout, such as Main Menu.

  2. Open the Add Element menu.

    • Phone or tablet: Long press (touch and hold) the empty space under the Elements list.
    • Desktop: Right-click (click with the right mouse button) the empty space under the Elements list.
  3. Scroll down the menu. Tap Fragment. The Insert Fragment box opens.

    The Add Element menu on a phone, open under the empty Elements list of the Main Menu layout. The menu is scrolled down, and Fragment is marked. The Add Element menu on desktop, open under the empty Elements list of the Main Menu layout. The menu is scrolled down, and Fragment is marked.
  4. Under Fragment, choose the fragment, such as Back Button. The list shows only fragments.

  5. Tap Insert Fragment.

    The Insert Fragment box on a phone. Back Button is chosen under Fragment. The list and the Insert Fragment button are marked. The Insert Fragment box on desktop. Back Button is chosen under Fragment. The list and the Insert Fragment button are marked.

The fragment appears in the Elements list, with the name of its layout. On the canvas, it shows everything in the fragment, in the top left corner.

To move the fragment, change Position X and Position Y, or drag it on the canvas. See Move and resize an element.

Change the fragment

You change a fragment in its own layout. Every layout that uses it then shows the change.

  1. Open the fragment layout, such as Back Button.
  2. Change what you need. For example, change the picture of the image to box-3. See Change the picture.
  3. Open Main Menu again.

The fragment now shows the new picture.

The Main Menu layout on a phone. In the Elements list, the Back Button fragment is marked. On the canvas, the fragment now shows the picture box-3, marked. The Main Menu layout on desktop. In the Elements list, the Back Button fragment is marked. On the canvas, the fragment now shows the picture box-3, marked.

In Main Menu, you cannot select or change the elements inside the fragment. A tap on them selects the whole fragment.

Fragment settings

Setting What it does
Fragment The fragment layout that it shows. To show another fragment, choose it from the list.
Position X, Position Y, and Anchor Where the fragment is. A fragment has no Width or Height.

The other settings, such as Opacity and Visibility, are the same for most elements. See Change an element's settings. A fragment has no Actions.

Good to know

  • You cannot delete a fragment layout, or set it back to No, while a layout uses it. If you try, you see an error, such as Failed to update layout. First delete the Fragment elements that show it.

Next steps