Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RK311y opened this issue Jul 29, 2023 · 0 comments

Comments

@RK311y
Copy link
Contributor

RK311y commented Jul 29, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant