Skip to content

Configuration

Lukas Bestle edited this page Apr 10, 2023 · 2 revisions

Block settings

Every block setting can be configured from the Panel:

Screenshot of the advanced block settings

The first setting is for the configurator ID. Every embedded Roomle configurator needs a configurator ID. You can find it in Rubens Admin or you can contact your Roomle Contact Person.

The second setting is for the request target page. This page will be visited when the user clicks the "request product" button. In the block settings, you can only set an actual Kirby content page. If you need to define a different URL, you can set it from the global defaults (see below). If you have a global default but want to disable it for a specific block, select "None".

The Configurator options text box allows to override advanced options of the Roomle configurator. Use this field with care.

There is also another setting for the catalog root tag that only applies to room configurators (Roomle multi-object configurators, MoC). This setting controls which products the user can add to their room configuration. In the Panel, this setting can be configured in the "Behavior" tab:

Screenshot of the behavior block settings

Global defaults

You can set a global default for each of these settings in site/config/config.php.

It is recommended to set at least the configuratorId globally. This ensures that the blocks will still function if no custom configurator ID is set in the block settings. If you want to ensure that each block receives a custom configurator ID, you can leave the global default option unset.

<?php

return [
  'lukasbestle.roomle' => [
    // Roomle configurator ID (from your Roomle Contact Person);
    // you can test the plugin with the ID `demoConfigurator`;
    // REQUIRED (either globally or in the block settings)
    'configuratorId' => null, // e.g. `'demoConfigurator'`

    // Root tag in the Roomle catalog that selects all products
    // that can be added in the room configurator (MoC)
    'catalogRootTag' => null,

    // page to redirect to when "request product" is clicked;
    // defaults to none (request product feature is disabled)
    'target' => null, // e.g. `'path/to/page'`

    // custom options for the Roomle configurator;
    // see https://docs.roomle.com/web/embedding/api/interfaces/types.UiInitData.html
    'options' => [], // e.g. `['skin' => ['primary-color' => '#123456']]`
  ]
];

The configuratorId, catalogRootTag and target will be overridden by custom values in the block settings.

The options are merged: First the Roomle plugin defines dynamic defaults based on the block data. These are overridden by values in config.php and these are again overridden by the options defined in the block and finally by specific block settings.