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

未关闭
#713 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
38/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
停滞
技术栈
php
领域
documentation

调研方向

The issue points to the Fluid Fieldtype Development documentation and includes an example of the return formats for standard and grid content types. Start by locating that section in the user guide and compare its guidance with the example. Done means the documentation explains the expected display_settings() and grid_display_settings() return formats for grid fields.

由索引模型根据 Issue 内容生成。

描述

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!

主要语言
CSS
星标
22
派生
79
平均合并
2 天 1 小时
30 天内合并 PR
6

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ExpressionEngine/ExpressionEngine-User-Guide 的其他 Issue

查看 ExpressionEngine/ExpressionEngine-User-Guide 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。