From 4a335b83461bdc561ba8a536af8c9bc4946e3fce Mon Sep 17 00:00:00 2001 From: Faakhir30 Date: Sun, 13 Oct 2024 20:37:31 +0500 Subject: [PATCH] Used resource title instead of resource type in page title. --- packages/volto/news/6308.internal | 1 + .../volto/src/components/manage/Edit/Edit.jsx | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 packages/volto/news/6308.internal diff --git a/packages/volto/news/6308.internal b/packages/volto/news/6308.internal new file mode 100644 index 00000000000..c2b9271b6b0 --- /dev/null +++ b/packages/volto/news/6308.internal @@ -0,0 +1 @@ +Used `resource title` instead of `resource type` in page title on edit. @Faakhir30 diff --git a/packages/volto/src/components/manage/Edit/Edit.jsx b/packages/volto/src/components/manage/Edit/Edit.jsx index 333f6cf6514..5e2dd89d410 100644 --- a/packages/volto/src/components/manage/Edit/Edit.jsx +++ b/packages/volto/src/components/manage/Edit/Edit.jsx @@ -51,8 +51,8 @@ import config from '@plone/volto/registry'; const messages = defineMessages({ edit: { - id: 'Edit {title}', - defaultMessage: 'Edit {title}', + id: 'Edit - {title}', + defaultMessage: 'Edit - {title}', }, save: { id: 'Save', @@ -346,11 +346,18 @@ class Edit extends Component { <> 0 ? this.props.intl.formatMessage(messages.edit, { - title: this.props.schema.title, + title: + this.props?.content?.['@components']?.breadcrumbs + ?.items[0]?.title, }) - : null + : this.props?.schema?.title + ? this.props.intl.formatMessage(messages.edit, { + title: this.props.schema.title, + }) + : null } > {this.props.content?.language && (