-
-
Notifications
You must be signed in to change notification settings - Fork 889
6653 contenttype menu #8032
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
base: seven
Are you sure you want to change the base?
6653 contenttype menu #8032
Changes from 20 commits
2da629e
ddf08e2
bd73eed
50e8e9b
22462dc
2e57560
83f9ad5
6519d69
10e63c2
3281f91
3fe8c3a
626915c
e0d64d2
645db43
6e8eee7
4b5feef
0f50287
b2e351b
f8341a4
2fc531a
2e4132a
5da049f
9240a9e
c2ad148
3f2e9ab
b108cde
6b35555
18cb271
12e4c89
4d51d80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Use `types` API expander when token is available. @arybakov05 |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,12 +11,14 @@ myst: | |||||||
|
|
||||||||
| # Component registry | ||||||||
|
|
||||||||
| The {term}`configuration registry` has a component registry integrated on itself. | ||||||||
| These registry stores by a given name the components. | ||||||||
| Later you can retrieve them by this name, and use them in your code. | ||||||||
| The idea behind is to provide an alternative and more convenient way to customize components. | ||||||||
| You can override programmatically such registrations from your add-on or projects because it's stored in the configuration registry. | ||||||||
| You can customize a component without using {term}`shadowing` at all, if the code that calls the component retrieves the information of the component to use from the component registry. | ||||||||
| The {term}`configuration registry` includes a component registry for managing components globally. | ||||||||
| In this registry, components can be registered given a unique component name. | ||||||||
| Any other add-on can then retrieve and use this component by searching the components name. | ||||||||
|
||||||||
| Any other add-on can then retrieve and use this component by searching the components name. | |
| Any other add-on can then retrieve and use this component by searching for the component's name. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline literals aren't necessary here. Also use the imperative form.
| To register a component with dependencies, you can either pass a `string` or an `array of strings`. | |
| To register a component with dependencies, either pass a string or an array of strings. | |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| --- | ||
| myst: | ||
| html_meta: | ||
| "description": "How to access and modify the configuration regisrey" | ||
| "property=og:description": "How to access and modify the configuration registry" | ||
| "property=og:title": "Customize Seven using the configuration registry" | ||
| "keywords": "Seven, @plone/registry, registry, configuration" | ||
| --- | ||
|
|
||
| # Customize Seven using the configuration registry | ||
|
|
||
| The registry is the central place for configuring your Seven application. | ||
| If the default location has not been modified, you can locate the configuration in the `settings.ts` file in the `config` folder of your add-on. | ||
| Existing entries can be modified or new entries can be added. | ||
|
|
||
| ```ts | ||
| import type { ConfigType } from '@plone/registry'; | ||
| import MyBlockInfo from 'my/addon/blocks/MyBlockInfo'; | ||
|
|
||
| export default function install(config: ConfigType) { | ||
| // Example: registering a new block | ||
| config.blocks.blocksConfig.myBlock = MyBlockInfo; | ||
|
|
||
| // Example: Adding a content type to the "most used" section | ||
| // of the content type menu in the toolbar | ||
| config.settings.mostUsedTypes = [ | ||
| // Make sure not to override existing entries, | ||
| // but to keep existing values unless you actually want to | ||
| ...config.settings.mostUsedTypes, | ||
| 'My Content Type', | ||
| ]; | ||
|
|
||
| // Rest of your configuration goes here | ||
|
|
||
| return config; | ||
| } | ||
| ``` | ||
|
|
||
| To then access the configuration in your code, the config can be imported from `@plone/registry`. | ||
|
|
||
| ```ts | ||
| import config from '@plone/registry'; | ||
|
|
||
| const mostUsedTypes = config.settings.mostUsedTypes; | ||
| // Value: ["Document", "Folder", "File", "My Content Type"] | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ myst: | |
| ```{toctree} | ||
| :maxdepth: 2 | ||
|
|
||
| configuration-registry | ||
| component-registry | ||
| expanders | ||
| ``` | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { useAtom } from 'jotai'; | ||
| import { sidebarAtom } from '../Sidebar/Sidebar'; | ||
| import Settings from '@plone/components/icons/settings.svg?react'; | ||
| import { useTranslation } from 'react-i18next'; | ||
|
|
||
| export const ToolbarSettings = () => { | ||
| const { t } = useTranslation(); | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const [collapsed, setCollapsed] = useAtom(sidebarAtom); | ||
|
|
||
| return ( | ||
| <button | ||
| type="button" | ||
| aria-label={t('cmsui.toolbar.settings')} | ||
| title={t('cmsui.toolbar.settings')} | ||
| onClick={() => setCollapsed((state) => !state)} | ||
| > | ||
| <Settings /> | ||
| </button> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| { | ||
| "cmsui": { | ||
| "edit": "Bearbeiten", | ||
| "save": "Speichern", | ||
| "controlpanel": "Konfiguration", | ||
| "objectbrowserwidget": { | ||
| "openDialog": "Inhalt auswählen", | ||
| "dialogTitle": "Inhalt auswählen", | ||
| "closeDialog": "Auswahl schließen", | ||
| "openSearch": "Inhalt durchsuchen", | ||
| "closeSearch": "Suche schließen", | ||
| "searchPlaceholder": "Inhalt durchsuchen...", | ||
| "loading": "Lade...", | ||
| "routeannouncer": "Aktueller Pfad: {{route}}", | ||
| "noResults": "Keine Inhalte gefunden", | ||
| "searchResults": "Suchergebnisse: {{count}} Inhalte", | ||
| "searchResultsFor": "Suchergebnisse für \"{{searchTerm}}\": {{count}} ", | ||
| "goback": "Zurück", | ||
| "changeViewMode": "Zur {{mode}} Ansicht wechseln", | ||
| "currentItems": "Aktuelle Inhaltselemente", | ||
| "home": "Startseite", | ||
| "item": "{{title}}", | ||
| "itemSelected": "ausgewählt", | ||
| "itemNotSelectable": "nicht auswählbar", | ||
| "itemNavigateTo": "Zu {{title}} navigieren", | ||
| "canNavigateTo": "Verschachtelbarer Inhalt", | ||
| "workflowStates": { | ||
| "private": "Privat", | ||
| "pending": "Ausstehend", | ||
| "published": "Veröffentlicht" | ||
| }, | ||
| "viewModes": { | ||
| "list": "Listenansicht", | ||
| "grid": "Kachelansicht" | ||
| } | ||
| }, | ||
| "panelgroups": { | ||
| "general": "Allgemein", | ||
| "content": "Inhalt", | ||
| "security": "Sicherheit", | ||
| "users": "Benutzer", | ||
| "site": "Seiteneinstellungen", | ||
| "addons": "Erweiterungen", | ||
| "maintenance": "Wartung" | ||
| }, | ||
| "paneltitles": { | ||
| "addons": "Erweiterungen", | ||
| "database": "Datenbank", | ||
| "contentRules": "Inhaltsregeln", | ||
| "undo": "Rückgängig machen", | ||
| "urlmanagement": "URL Verwaltung", | ||
| "relations": "Relationen", | ||
| "moderatecomments": "Kommentare moderieren", | ||
| "users": "Benutzer", | ||
| "groupMembership": "Gruppenmitgliedschaft", | ||
| "groups": "Gruppen" | ||
| }, | ||
| "blocksEditor": { | ||
| "blocksTab": "Blöcke", | ||
| "contentTab": "Inhalt" | ||
| }, | ||
| "sidebar": { | ||
| "label": "Seitenleiste" | ||
| }, | ||
| "toolbar": { | ||
| "settings": "Einstellungen" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,9 @@ | |
| }, | ||
| "sidebar": { | ||
| "label": "Sidebar" | ||
| }, | ||
| "toolbar": { | ||
| "settings": "Settings" | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,9 @@ | |
| }, | ||
| "sidebar": { | ||
| "label": "Barra laterale destra" | ||
| }, | ||
| "toolbar": { | ||
| "settings": "Impostazioni" | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Moved toolbar settings button into a slot. | ||
| Added German translations. @arybakov05 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1 @@ | ||||||
| Extended customizability of the Menu component. @arybakov05 | ||||||
|
||||||
| Extended customizability of the Menu component. @arybakov05 | |
| Extended customizability of the `Menu` component. @arybakov05 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sneridagh @pnicolli @davisagli I like the revisions on this page, as it improves grammar and readability. Would you please check it for technical accuracy?