Homepage
Main navigation
Main content
Additional information
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Winter CMS resources and help articles
Simple and to the point. Optimized by the community.
×
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Edit trick
Changes will be published after manual review
Title
Give your trick a describing title. Do
not
start with «How to...».
Your trick
Keep it short and concise! Markdown is supported.
When you display a relation list and click on it, it opens a popup (if not using recordUrl). The SecondaryTab fields in your fields.yaml are placed under a label called 'Misc'. This is the value of '[defaultTab](https://wintercms.com/docs/backend/forms#form-tab-options)' for SecondaryTabs. See:  The annoying part (in my opinion) is that these fields are not displayed in a tab. These fields will always be displayed at the bottom of your relation popup. If you want, you can modify your fields.yaml, allowing you to place these fields in a tab. It's actually really easy. 1) Create a custom context for your relation popup using 'context: myValue' ``` myRelation: label: myRelation view: ... manage: form: ~/plugins/author/plugin/models/model/fields.yaml context: relation ``` 2) Now you can use '@relation' in your fields.yaml. Whenever you manage myRelation, it will now have the context 'relation', allowing you to display the fields that you desire. For example: ``` created_at@relation: tab: Misc label: Created at type: datepicker mode: date format: d/m/Y default: now ``` This field will only be shown when you are managing myRelation with the context: relation. 3) In SecondaryTabs, you can add @create, @update, @preview, to display the field when NOT in context: relation ``` secondaryTabs: fields: created_at: label: Created at type: datepicker mode: date format: d/m/Y default: now context: ['create', 'update', 'preview'] ``` *created_at* will now be displayed in the secondaryTabs fields when in context: Create, Update, Preview. *created_at* will now be displayed in the relation popup fields when in context: relatiation. The only downside is that you have defined *created_at* twice in your fields.yaml file.
References
Add additional online resources to your trick
×
Name
URL
×
Name
URL
×
Name
URL
+ Add reference
Topics
If your trick fits more than one topic select multiple. Select at least one.
Backend
Plugin Development
CMS
Twig
Themes
Deployment
Tags
You can use existing tags or create new ones. Add at least one.
Submit for review
Cancel
We use cookies to measure the performance of this website. Do you want to accept these cookies?
Accept
Decline