Skip to content

Fluid Fieldtype Development - dislpay_settings() v.s. grid_display_settings() return data format #713

Description

@RK311y

Suggested Change

To display settings for field types that support grid content types, the array returned from display_settings() method is a bit different.

Example: The relationship field makes this distinction by checking for the parent content type within the display_settings() method routine. See here: https://github.com/ExpressionEngine/ExpressionEngine/blob/61e559413f40324d888ff9ebf4f43dc5f74e8ea1/system/ee/ExpressionEngine/Addons/relationship/ft.relationship.php#L789-L797

Standard Channel Field display_settings()

$settings = array(
    // some SharedForm field settings
);

// return settings for standard channel field
return array('field_options_custom_field' => array(
      'label' => 'field_options',
      'group' => 'custom_field',
      'settings' => $settings
  ));

Fluid Field display_settings()

$settings = array(
    // some SharedForm field settings
);

// return settings for standard channel field
if ($this->content_type() == 'grid') {
    return array('field_options' => $settings);
}

NOTE: this should also be the format for data returned from grid_display_settings()

Reasoning

The documentation for Fluid Fieldtype Development does not explain this.

Additional context

@intoeetive I tried to look and see if this documentation already existed, but I do not believe that it does. If I missed it, please let me know!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions