useAsTitle function hook #1105
Replies: 3 comments 2 replies
-
Yeah! I don't think this would be too bad for performance actually and we would happily accept a PR to allow for this. It'd be a pretty simple one to do. I'd probably just CMD+F for all instances of Good call! I like it! |
Beta Was this translation helpful? Give feedback.
-
The team just reviewed this discussion and came up with a few reason why this will actually be quite a negative performance impact. It will also never be able to support async functions because of its heavy usage in the relationship field component. A really nice way to do this would be to use a disabled field and a field hook to generate a title on the backend. We actually do this in our own website CMS where we use a hidden |
Beta Was this translation helpful? Give feedback.
-
@zubricks I think to work around performance issues this could be split into 2 separate changes:
What do you think? The second change would be useful on its own, for cases where the title value is an object and it should be rendered to a title. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Maybe its a terrible idea for performance 🤔 , but I think it would be very useful if the
useAsTitle
config could accept a function taking the current document and returning any string as title. That way the developer could implement titles for many use cases.Related:
Beta Was this translation helpful? Give feedback.
All reactions