Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Making the name/title of an item in a global collection dynamic

default discord avatar
baameow11 months ago
7

For context: when creating a new nav item in the Header for example, it is displayed as "Nav Item 01" when you navigate to the Header in the admin panel. How can I update this value before it gets saved? I'm guessing there is a hook available, but I'm not sure what this property would be called. Thank you.



  • default discord avatar
    zed054711 months ago

    This is a custom component located in your website template at the Header/RowLabel.tsx component

  • default discord avatar
    baameow11 months ago

    Thank you!

  • default discord avatar
    zed054711 months ago

    My pleasure

  • default discord avatar
    baameow11 months ago

    Sorry, one more thing. If the nav item has a category, right now the categories array that gets returned in this RowLabel component is just an array of numbers. Is there a reliable way of populating/retrieving this data so the category can be displayed in the label as well?

  • default discord avatar
    zed054711 months ago

    For sure - you want to use the Payload local api to fetch these



    It's an array of IDs



    A

    payload

    instance is passed to your RSC there

  • default discord avatar
    baameow11 months ago

    Awesome! Thanks so much

  • default discord avatar
    zed054711 months ago

    My pleasure!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.