Skip to content

Clarify that the SEO tabbedUI option checks for the first field after any plugins that appear before it run #12355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
evelynhathaway opened this issue May 8, 2025 · 0 comments · Fixed by #12549
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@evelynhathaway
Copy link

Documentation Issue

This section of the SEO plugin documentation could potentially be improved to warn about plugins that run before the SEO plugin adding hidden fields, causing two sets of tabs.

If your collection is not already tab-enabled, meaning the first field in your config is not of type tabs, then one will be created for you called Content.

From SEO plugin - tabbedUI

It may be a good idea to nudge developers to check their plugin order if the tabbedUI logic cannot be updated to skip hidden fields or perform a quick field search at the root level. Including or linking to the tab field order limitation from the JSDoc would also be beneficial.

Additional Details

Using the first party multi tenant plugin before the SEO plugin causes a hidden tenant field to be added to the start of that collection's field config.

export default buildConfig({
  // [...]
  plugins: [
    multiTenantPlugin({
      collections: {
        pages: {},
      },
    }),
    seoPlugin({
      tabbedUI: true,
      collections: ["pages"],
    }),
  ],
});

Which is a minor head scratcher since the tenant field is hidden from the UI and of course not in your collection config source code. The JSDoc for tabbedUI doesn't even mention the limitation, and instead lead to me believe that possibly something changed and I needed to use the direct field escape hatch. Luckily I reread the documentation for tabbedUI, but it also didn't immediately clue me in to this interaction.

The fix for me was simple and prefered over the direct fields, changing the order of the plugins in the config.

export default buildConfig({
  // [...]
  plugins: [
    seoPlugin({
      tabbedUI: true,
      collections: ["pages"],
    }),
    multiTenantPlugin({
      collections: {
        pages: {},
      },
    }),
  ],
});
@evelynhathaway evelynhathaway added the documentation Improvements or additions to documentation label May 8, 2025
@paulpopus paulpopus self-assigned this May 12, 2025
paulpopus added a commit that referenced this issue Jun 3, 2025
…ith the config option (#12549)

Closes #12355

TabbedUI doesn't always work as intended and it can be affected by
existing fields or the order of other plugins, this mentions that and
links to the recommended direct use of fields example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
2 participants