Skip to content

Commit

Permalink
Tidy up code samples
Browse files Browse the repository at this point in the history
  • Loading branch information
stevepiercy committed Feb 28, 2024
1 parent 8b37c10 commit 8ddb708
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions docs/source/configuration/slots.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,18 @@ Volto comes with the following default slots.

## Configuration registry for slot components

You register a slot component using the configuration registry:
You register a slot component using the configuration registry, as shown.

```ts
config.registerSlotComponent({
slot: 'toolbar',
name: 'save',
component: 'this is a toolbar save component with a true predicate',
predicates: [RouteCondition('/de')],
});
config.registerSlotComponent({
slot: 'toolbar',
name: 'save',
component: '@sneridagh this needs a component',
predicates: [
RouteCondition('/de'),
ContentTypeCondition(['Document', 'News Item'])
],
});
```

A slot component must have the following parameters.
Expand Down Expand Up @@ -181,11 +184,11 @@ This is the signature:

```ts
config.reorderSlotComponent({ slot, name, position, action, target }: {
slot: string;
name: string;
position?: number | undefined;
action?: "after" | "before" | "first" | "last" | undefined;
target?: string | undefined;
slot: string;
name: string;
position?: number | undefined;
action?: "after" | "before" | "first" | "last" | undefined;
target?: string | undefined;
}): void
```

Expand Down

0 comments on commit 8ddb708

Please sign in to comment.