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.

Hide admin tab depending on sibling data

default discord avatar
chris_heinz2 years ago
1

I am trying to hide/show a tab if a certain field is checked. Unfortunately my code within the condition is never called. It works perfectly fine as expected if I do the same in fields within the tab but not on tab level. Is there another way to conditionally hide a whole tab?


fields: [
    {
      type: "tabs",
      tabs: [
        {
          label: "SEO"
           admin: {
            condition: (doc, siblingData) => {
              // does not get called so the scope is not even reached
              console.log(siblingData);
              return siblingData?.overwriteMeta;
            },
          },
          fields: [here condition works fine]
       ]}]
  • discord user avatar
    jesschow
    last year

    @chris_heinz I believe conditional tabs is on our roadmap still

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.