diff --git a/.changeset/rude-eyes-go.md b/.changeset/rude-eyes-go.md new file mode 100644 index 00000000..58377375 --- /dev/null +++ b/.changeset/rude-eyes-go.md @@ -0,0 +1,5 @@ +--- +"strapi-plugin-webtools": patch +--- + +Update webtools search with mainField as key diff --git a/packages/core/server/controllers/search.ts b/packages/core/server/controllers/search.ts index c48e6b7a..5102d361 100644 --- a/packages/core/server/controllers/search.ts +++ b/packages/core/server/controllers/search.ts @@ -49,6 +49,7 @@ export default { const entriesWithContentType: SearchResult[] = entries.map((entry: DocumentEntry) => ({ ...entry, + mainField: entry[mainField], contentType: uid, })); @@ -88,7 +89,7 @@ export default { id: entry.id, documentId: entry.documentId, // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - ...(mainField ? { [mainField]: entry[mainField] } : {}), + ...(mainField ? { mainField: entry[mainField] } : {}), }; }, }; diff --git a/packages/docs/docs/addons/links/getting-started/custom-field.md b/packages/docs/docs/addons/links/getting-started/custom-field.md index 8dc583ff..936973de 100644 --- a/packages/docs/docs/addons/links/getting-started/custom-field.md +++ b/packages/docs/docs/addons/links/getting-started/custom-field.md @@ -8,3 +8,10 @@ slug: /addons/links/custom-field This addon introduces a new custom field which you can add to your content types. This field can be used in your content types to accommodate internal linking from one page to another. Link custom field + +### This custom field will provide you three options in the advanced settings: +* Set the link to "internal" and now you can search on something like "My first blog post". The field stores a documentId reference, so the link keeps working even if the slug or URL changes. +* Set the link to "external" so you can enter a full url, e.g. https://strapi.io/ +* Set the link to "Internal & external links" and have both link options as described above, this is the default value. + +Link advanced settings diff --git a/packages/docs/docs/addons/links/getting-started/installation.md b/packages/docs/docs/addons/links/getting-started/installation.md index ac8c9051..70b7f2aa 100644 --- a/packages/docs/docs/addons/links/getting-started/installation.md +++ b/packages/docs/docs/addons/links/getting-started/installation.md @@ -10,7 +10,7 @@ slug: /addons/links/installation Complete installation requirements are the exact same as for Strapi itself and can be found in the Strapi documentation. **Additional Requirements:** -- **Node.js**: Version 18 or higher +- **Node.js**: Version 18.18.2 or higher - **Strapi**: Version 5.x - **Webtools**: Version 1.x ::: diff --git a/packages/docs/static/img/assets/addons/links/webtools-pro-link-addon-options.png b/packages/docs/static/img/assets/addons/links/webtools-pro-link-addon-options.png new file mode 100644 index 00000000..a010f6a0 Binary files /dev/null and b/packages/docs/static/img/assets/addons/links/webtools-pro-link-addon-options.png differ