Hi, is it possible to add a component file path to the collection's admin.custom and then use the file path to import the component? Like if I'm rebuilding the Sidebar and I wanted to add icons next to each collection's title in the sidebar, I'd use the admin.custom to put some custom data there, but I'm wondering, can I put import paths?
#Adding Component File Paths to Collections `admin.custom`
9 messages · Page 1 of 1 (latest)
Original message from @icy cedar - Moved from #general message
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
- Swap in your own React components - Defining Custom Components - Import Map
- Swap in your own React components - Defining Custom Components - Component Paths
- Swap in your own React components - Defining Custom Components
- Swap in your own React components - Defining Custom Components - Config Options
- Collection Configs - Config Options
Hey @icy cedar,
I don't think you need admin.custom here to be honest. When you say sidebar do you mean the nav?
The leftmost vertical bar that houses all of the links to various collections grouped under a group name?
Thanks for moving it @prisma pilot . Yeah, I meant the nav component.
I have a comprehensive example of overwriting the nav component to add icons next to nav links here: https://github.com/akhrarovsaid/payload-theme-quantum-leap
Thanks! That theme is 🔥 btw. I see you have the naviconMap that does the icons for you, that's smart. I might end up using the same solution, idk why I thought it'll make more sense to update the icon in the collection config.
My pleasure, yeah have some fun with it!