| | 216 | |
| | 217 | === Exposing Dynamic Components on Tabs === |
| | 218 | |
| | 219 | To expose a dynamic component as a tab in the master record perspective, set component_tab=True for the component key: |
| | 220 | |
| | 221 | {{{#!python |
| | 222 | # Component key |
| | 223 | {"name": "organisation_id", |
| | 224 | "field_type": "reference org_organisation", |
| | 225 | "component_key": True, |
| | 226 | "component_alias": "rating", |
| | 227 | |
| | 228 | # Expose a component tab: |
| | 229 | "component_tab": True, |
| | 230 | |
| | 231 | }, |
| | 232 | }}} |
| | 233 | |
| | 234 | The component alias will be used to generate a tab label. To override this, configure a {{{tab_label}}} in the field settings: |
| | 235 | |
| | 236 | {{{#!python |
| | 237 | # Component key |
| | 238 | {"name": "organisation_id", |
| | 239 | "field_type": "reference org_organisation", |
| | 240 | "component_key": True, |
| | 241 | "component_alias": "rating", |
| | 242 | "component_tab": True, |
| | 243 | |
| | 244 | # Field settings to control the component tab: |
| | 245 | "settings": { |
| | 246 | "tab_label": "Performance Ratings", |
| | 247 | }, |
| | 248 | }, |
| | 249 | }}} |
| | 250 | |
| | 251 | The tab will be appended to the existing component tabs. To determine a tab position add a {{{tab_position}}} setting: |
| | 252 | |
| | 253 | {{{#!python |
| | 254 | # Component key |
| | 255 | {"name": "organisation_id", |
| | 256 | "field_type": "reference org_organisation", |
| | 257 | "component_key": True, |
| | 258 | "component_alias": "rating", |
| | 259 | "component_tab": True, |
| | 260 | |
| | 261 | # Field settings to control the component tab: |
| | 262 | "settings": { |
| | 263 | "tab_label": "Performance Ratings", |
| | 264 | "tab_position": 2, |
| | 265 | }, |
| | 266 | }, |
| | 267 | }}} |
| | 268 | |