Cannot customize rich text link base fields #2167
Replies: 4 comments 9 replies
-
Hey @evelynhathaway — this is a great call. It should also be pretty easy to accomplish. I think what we need to do is expose a property on the richText field as follows:
Basically, it'd be a function that would accept default fields and allow Payload devs to return them modified to suit their purpose. I don't think that this would be a good way to filter down the data returned still though... That might need to be done with an additional function - say something like:
This function could be shared and reused with any relationship populated by the rich text field. It could also automatically type the We'd run this function each time we populate an What do you think? This is a great feature. Not necessarily a bug or an issue, so I will move this to discussions, but I think this should be built ASAP. Speaking of moving this to a discussion, I will add this to the roadmap as Priority 2 (to be released within next quarter or sooner). But in the meantime we would happily accept a PR for this. If you're up for it, I am happy to help provide more info on how this would need to be accomplished. 👍 |
Beta Was this translation helpful? Give feedback.
-
Yeah! Maybe we should also be able to disable the default fields entirely (except for the "Text to display"). I have a custom reusable field for the links in my project but when I add it to the Rich Text field's It would be nice to remove them and use my own fields there. |
Beta Was this translation helpful? Give feedback.
-
Collection |
Beta Was this translation helpful? Give feedback.
-
Between the following MRs, I think everything from this discussion is complete.
As a note from my implementation, if you replace the default fields (e.g. to make a consistent API with a custom Link |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
From what I can tell, there isn't a way to customize the fields that the link modal that displays in rich text fields. The custom fields and the native fields are isolated from each other.
payload/src/admin/components/forms/field-types/RichText/elements/link/LinkDrawer/baseFields.ts
Line 16 in baf5b10
payload/src/admin/components/forms/field-types/RichText/elements/link/Button/index.tsx
Lines 71 to 89 in 25c5b78
This means users can't:
Users
)Beta Was this translation helpful? Give feedback.
All reactions