Configuration

Castorcito components can be used in any entity that allows the addition of custom fields. When you install the Castorcito module, the Json field (json_field) module is also automatically installed, which provides a new field type called Data. This field allows the integration of components within entities, enabling the use of the “Castorcito component” widget in the “Manage form display” tab and the “Castorcito component” formatter in the “Manage display” tab.
The steps required to create a Data type field and configure both the widget and the formatter in a content type, for example, “Basic page,” are described below.


Create the “Data” field

  1. On the administration menu.
  2. Click on the "Manage" then on “Structure” link and then on the “Content Types” link. 

    conent type

     

  3. Select the desired content type, in this example we will use the “Basic page” content type, click on the “Manage fields” button in the “Operations” column.

    basic page

     

  4. On the “Manage fields” page, click the “Create a new field” button.

    create field

     

  5. In the field type selector, choose “Data” and click “Continue.”

    data field

     

  6. Define the Label and System Name. Then, select the “JSON (raw)” option, which creates a JSON-type field at the database level. Click “Continue.”

    json raw

     

  7. Complete the remaining field settings and finish by clicking “Save settings.”

Widget configuration

  1. Access the “Manage form display” tab for the content type.

    form display

     

  2. Locate the newly created field and select the “Castorcito component” widget.

    castorcito component

     

  3. When you select the widget, a gear icon ⚙️ will be enabled. Click on it to configure the available components. In this example, only one component is shown, but if you have installed the Base Pack and Advanced Pack, many more components will be available. in the "Component list" and also later in the content creation or editing form. Depending on the components selected, specific configuration options will be displayed for each one. These allow you to override the component's default settings, providing flexibility to adapt its behavior based on the field and content type.

    configuration component

     

  4. Click “Save” to save the widget settings.

    save widget settings

     

Display configuration

  1. Go to the “Manage display” tab for the content type.

    manage display

     

  2. Locate the field and select the “Castorcito component” format.

    castorcito comp.

     

  3. When selected, a gear icon ⚙️ will also appear. Click to access the formatter settings. In this section, you can override the display options defined in the component, allowing you to customize how it will be displayed in this specific field. For example in the Slideshow component from the Basepack you will find options for the slide speed, autoplay, hide the paginations, etc.

    display settings

     

  4. Click “Update” to save the formatter settings. And save.

    save