diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index a59c36f..ef59b24 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -11,6 +11,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#: components/Logo/schema +# defaultMessage: Description +msgid "Description" +msgstr "Beschreibung" + #: components/Logo/schema # defaultMessage: It is advised to use a svg graphic. msgid "It is advised to use a svg graphic." @@ -36,8 +41,3 @@ msgstr "Bitte wählen Sie ein Logo als Quelle für dieses Element" # defaultMessage: Title msgid "Title" msgstr "Titel" - -#: components/Logo/schema -# defaultMessage: description -msgid "description" -msgstr "Beschreibung" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index 173d07c..dc6fb80 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -11,6 +11,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#: components/Logo/schema +# defaultMessage: Description +msgid "Description" +msgstr "" + #: components/Logo/schema # defaultMessage: It is advised to use a svg graphic. msgid "It is advised to use a svg graphic." @@ -36,8 +41,3 @@ msgstr "Please choose a logo as source for this element" # defaultMessage: Title msgid "Title" msgstr "" - -#: components/Logo/schema -# defaultMessage: description -msgid "description" -msgstr "description" diff --git a/locales/volto.pot b/locales/volto.pot index 7c80604..cf19026 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2023-12-11T12:47:09.894Z\n" +"POT-Creation-Date: 2023-12-18T15:12:47.088Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -13,6 +13,11 @@ msgstr "" "Preferred-Encodings: utf-8\n" "Domain: volto\n" +#: components/Logo/schema +# defaultMessage: Description +msgid "Description" +msgstr "" + #: components/Logo/schema # defaultMessage: It is advised to use a svg graphic. msgid "It is advised to use a svg graphic." @@ -38,8 +43,3 @@ msgstr "" # defaultMessage: Title msgid "Title" msgstr "" - -#: components/Logo/schema -# defaultMessage: description -msgid "description" -msgstr "" diff --git a/news/1.bugfix b/news/1.bugfix new file mode 100644 index 0000000..834691e --- /dev/null +++ b/news/1.bugfix @@ -0,0 +1 @@ +fix link element being rendered even when no link is set @jackahl diff --git a/news/1.feature b/news/1.feature new file mode 100644 index 0000000..b35ab50 --- /dev/null +++ b/news/1.feature @@ -0,0 +1 @@ +add setting to show or not show description field @jackahl diff --git a/news/1.minor b/news/1.minor deleted file mode 100644 index 5505847..0000000 --- a/news/1.minor +++ /dev/null @@ -1 +0,0 @@ -fix link element bein rendered even when no link is set @jackahl diff --git a/src/components/Logo/View.jsx b/src/components/Logo/View.jsx index fe112bf..ee258cd 100644 --- a/src/components/Logo/View.jsx +++ b/src/components/Logo/View.jsx @@ -3,6 +3,7 @@ import { flattenToAppURL } from '@plone/volto/helpers'; import { UniversalLink } from '@plone/volto/components'; import { Message } from 'semantic-ui-react'; import { defineMessages, useIntl } from 'react-intl'; +import config from '@plone/volto/registry'; import imageBlockSVG from '@plone/volto/components/manage/Blocks/Image/block-image.svg'; const messages = defineMessages({ @@ -45,7 +46,8 @@ const View = (props) => { ))}

{data.heading}

- {data.description &&

{data.description}

} + {config.blocks.blocksConfig.logo.showDescriptionField && + data.description &&

{data.description}

} ); }; diff --git a/src/components/Logo/schema.js b/src/components/Logo/schema.js index b043e38..5cb6a5d 100644 --- a/src/components/Logo/schema.js +++ b/src/components/Logo/schema.js @@ -1,4 +1,5 @@ import { defineMessages } from 'react-intl'; +import config from '@plone/volto/registry'; const messages = defineMessages({ logo: { @@ -10,8 +11,8 @@ const messages = defineMessages({ defaultMessage: 'Title', }, description: { - id: 'description', - defaultMessage: 'description', + id: 'Description', + defaultMessage: 'Description', }, logoBlock: { id: 'Logo', @@ -35,7 +36,12 @@ export const LogoBlockSchema = (props) => { { id: 'default', title: 'Default', - fields: ['logo', 'heading', 'link'], + fields: [ + 'logo', + 'heading', + config.blocks.blocksConfig.logo.showDescriptionField && 'description', + 'link', + ], }, ], properties: { diff --git a/src/index.js b/src/index.js index 816ab52..004a4f2 100644 --- a/src/index.js +++ b/src/index.js @@ -17,6 +17,7 @@ const applyConfig = (config) => { restricted: true, mostUsed: true, sidebarTab: 1, + showDescriptionField: false, }; config.blocks.blocksConfig.logos = { ...config.blocks.blocksConfig.gridBlock,