meta group to the collections you list. The group holds a meta title, description, and image, a search result preview, and a completeness overview. Each field can offer an “Auto-generate” button backed by a function you provide.
Install
Configure
An “Auto-generate” button appears only on fields whose generate function you provide.
Generate functions
Every generate function receives the sameGenerateArgs object:
Checking
collectionSlug narrows doc to that collection’s type:
collections can’t use the generate functions. When a request is rejected, the “Auto-generate” button clears the field instead of filling it, so check the user’s access if a field empties.
Place the fields yourself
To put the SEO fields in your own layout, such as a “Search” tab, build them with the factories from@frogbotai/plugin-seo/fields and still list the collection in collections. The plugin finds the factory fields and adds nothing to that collection, so it has exactly one meta group, and “Auto-generate” still works.
posts gets the automatic meta group and pages keeps its own layout. Pass hasGenerateFn: true to a field whose generate function you provide, to show its “Auto-generate” button; on PreviewField it uses generateURL.
Each factory takes one argument object. overrides is spread over the returned field last, so it can replace any property, including name and admin.
The factories return FrogBot fields, so they need no casts, and
overrides accepts FrogBot hooks, access, and validation.
How the plugin detects placed fields:
- It looks through the collection’s fields, including tabs, groups, rows, and collapsibles. Fields inside blocks and arrays don’t count.
- One factory field is enough. The plugin doesn’t add the ones you left out.
- Fields you write by hand, and factory fields whose
overridesreplace the admin component, aren’t detected. That collection still gets the automatic group.
meta, as above, so the fields are stored at meta.title, meta.description, and meta.image, where the overview and preview look for them. Under another name, pass titlePath, descriptionPath, and imagePath to OverviewField, and titlePath and descriptionPath to PreviewField.