Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 14/umbraco-cms/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
* [Workspace Context](extending-backoffice/extension-types/workspaces/workspace-context.md)
* [Workspace Views](extending-backoffice/extension-types/workspaces/workspace-editor-views.md)
* [Workspace Actions](extending-backoffice/extension-types/workspaces/workspace-editor-actions.md)
* [Section](extending-backoffice/extension-types/sections-and-trees/README.md)
* [Section View](extending-backoffice/extension-types/sections-and-trees/section-view.md)
* [Section Sidebar](extending-backoffice/extension-types/sections-and-trees/section-sidebar.md)
* [Section](extending-backoffice/extension-types/sections/README.md)
* [Section View](extending-backoffice/extension-types/sections/section-view.md)
* [Section Sidebar](extending-backoffice/extension-types/sections/section-sidebar.md)
* [Menu](extending-backoffice/extension-types/menu/README.md)
* [Trees](extending-backoffice/extension-types/menu/trees.md)
* [Header Apps](extending-backoffice/extension-types/header-apps.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ This page is a work in progress.
type: 'globalContext',
alias: 'My.GlobalContext.Products',
name: 'My Products Context',
js: 'my-products.context.js',
api: 'my-products.context.js',
}
```

Read more about creating your own[ Context API ](../working-with-data/context-api.md)here.
Read more about creating your own[Context API](../working-with-data/context-api.md)here.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ This example declares a Dashboard as part of your Package, using the Vite exampl
"type": "dashboard",
"alias": "My.Dashboard.MyExtension",
"name": "My Dashboard",
"js": "/App_Plugins/my-dashboard/dist/my-dashboard.js",
"element": "/App_Plugins/my-dashboard/dist/my-dashboard.js",
"elementName": "my-element",
"meta": {
"label": "My Dashboard",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
This page is a work in progress. It will be updated as the software evolves.
{% endhint %}

The `entryPoint` extension type can be used to run some JavaScript code at startup.\
The `backofficeEntryPoint` extension type can be used to run some JavaScript code at startup.\
The entry point declares a single JavaScript file that will be loaded and run when the Backoffice starts. In other words this can be used as an entry point for a package.

The `entryPoint` extension is also the way to go if you want to load in external libraries such as jQuery, Angular, React, etc. You can use the `entryPoint` to load in the external libraries to be shared by all your extensions. Additionally, **global CSS files** can also be used in the `entryPoint` extension.
The `backofficeEntryPoint` extension is also the way to go if you want to load in external libraries such as jQuery, Angular, React, etc. You can use the `backofficeEntryPoint` to load in the external libraries to be shared by all your extensions. Additionally, **global CSS files** can also be used in the `backofficeEntryPoint` extension.

The Entry Point manifest type is used to register an entry point for the backoffice. An entry point is a single JavaScript file that is loaded when the backoffice is initialized. This file can be used to do anything, this enables more complex logic to take place on startup.


**Register an entry point in a JSON manifest**

```typescript
{
"type": "entryPoint",
"alias": "My.EntryPoint",
"js": "./index.js"
"type": "backofficeEntryPoint",
"alias": "My.EntryPoint",
"js": "./index.js"
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ In the following example we define the manifest for a Workspace Action, this act

```typescript
{
type: 'workspaceAction',
name: 'example-workspace-action',
alias: 'My.Example.WorkspaceAction',
elementName: 'my-workspace-action-element',
conditions: [
{
alias: 'Umb.Condition.SectionAlias',
match: 'My.Example.Workspace'
}
]
type: 'workspaceAction',
name: 'example-workspace-action',
alias: 'My.Example.WorkspaceAction',
elementName: 'my-workspace-action-element',
conditions: [
{
alias: 'Umb.Condition.SectionAlias',
match: 'My.Example.Workspace'
}
]
}
```

Expand All @@ -52,29 +52,29 @@ You can make your own conditions by creating a class that implements the `UmbExt
```typescript
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
import {
ManifestCondition,
UmbConditionConfigBase,
UmbConditionControllerArguments,
UmbExtensionCondition,
ManifestCondition,
UmbConditionConfigBase,
UmbConditionControllerArguments,
UmbExtensionCondition,
} from '@umbraco-cms/backoffice/extension-api';
import { UMB_SECTION_CONTEXT } from '@umbraco-cms/backoffice/section';

type MyConditionConfig = UmbConditionConfigBase & {
match: string;
match: string;
};

export class MyExtensionCondition extends UmbControllerBase implements UmbExtensionCondition {
config: MyConditionConfig;
permitted = false;

constructor(args: UmbConditionControllerArguments<MyConditionConfig>) {
super(args.host);
// This condition aproves after 10 seconds
setTimeout(() => {
this.permitted = strue;
args.onChange();
}, 10000);
}
config: MyConditionConfig;
permitted = false;

constructor(args: UmbConditionControllerArguments<MyConditionConfig>) {
super(args.host);
// This condition aproves after 10 seconds
setTimeout(() => {
this.permitted = strue;
args.onChange();
}, 10000);
}
}
```

Expand All @@ -84,9 +84,9 @@ TODO: Make an example that will work from JSON (not a direct reference to the cl

```typescript
export const manifest: ManifestCondition = {
type: 'condition',
name: 'My Condition',
alias: 'My.Condition.TenSecondDelay',
api: MyExtensionCondition,
type: 'condition',
name: 'My Condition',
alias: 'My.Condition.TenSecondDelay',
api: MyExtensionCondition,
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Declaring a new extension is done using an extension manifest depending where yo
1. Via a manifest JSON file on the server.
2. In JavaScript/TypeScript file.

These two options can be combined by defining a small extension in a JSON Manifest, which uses the extension type `entryPoint` or `bundle` to register a JS file, which then registers the rest of the extensions.
These two options can be combined by defining a small extension in a JSON Manifest. This uses the extension type `backofficeEntryPoint` or `bundle` to register a JS file, which then registers the rest of the extensions.

#### Extension Manifest <a href="#extension-manifest" id="extension-manifest"></a>

Expand Down
10 changes: 5 additions & 5 deletions 14/umbraco-cms/extending-backoffice/extension-types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ The bundle extension type can be used for declaring multiple Extension Manifests

The bundle declares a single JavaScript file that will be loaded at startup. All the Extension Manifests exported from this Module will be registered in the Extension Registry.

Read more about the `bundle` extension type in the [Bundle ](../extension-registry/bundle.md)article.
Read more about the `bundle` extension type in the [Bundle](../extension-registry/bundle.md)article.

### Using `entryPoint` as your foundation
### Using `backofficeEntryPoint` as your foundation

The `entryPoint` extension type is special, it can be used to run any JavaScript code at startup.\
The `backofficeEntryPoint` extension type is special, it can be used to run any JavaScript code at startup.\
This can be used as an entry point for a package.\
The entry point declares a single JavaScript file that will be loaded and run when the Backoffice starts.

The `entryPoint` extension is also the way to go if you want to load in external libraries such as jQuery, Angular, React, etc. You can use the `entryPoint` to load in the external libraries to be shared by all your extensions. Loading **global CSS files** can also be used in the `entryPoint` extension.
The `entryPbackofficeEntryPointoint` extension is also the way to go if you want to load in external libraries such as jQuery, Angular, React, etc. You can use the `backofficeEntryPoint` to load in the external libraries to be shared by all your extensions. Loading **global CSS files** can also be used in the `backofficeEntryPoint` extension.

Read more about the `entryPoint` extension type in the [Entry Point](../extension-registry/entry-point.md) article.
Read more about the `backofficeEntryPoint` extension type in the [Entry Point](../extension-registry/entry-point.md) article.
32 changes: 16 additions & 16 deletions 14/umbraco-cms/extending-backoffice/extension-types/dashboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ Insert this as an entry of extensions in your `Umbraco-package.json` or register
```jsx

{
"type": "dashboard",
"alias": "my.welcome.dashboard",
"name": "My Welcome Dashboard",
"js": "/App_Plugins/WelcomeDashboard/dashboard.js",
"elementName": "my-welcome-dashboard",
"weight": -1,
"meta": {
"label": "Welcome Dashboard",
"pathname": "welcome-dashboard"
},
"conditions": [
{
"alias": "Umb.Condition.SectionAlias",
"match": "Umb.Section.Content"
}
]
"type": "dashboard",
"alias": "my.welcome.dashboard",
"name": "My Welcome Dashboard",
"element": "/App_Plugins/WelcomeDashboard/dashboard.js",
"elementName": "my-welcome-dashboard",
"weight": -1,
"meta": {
"label": "Welcome Dashboard",
"pathname": "welcome-dashboard"
},
"conditions": [
{
"alias": "Umb.Condition.SectionAlias",
"match": "Umb.Section.Content"
}
]
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Below you can find an example of how to setup a Header App using the manifest fi
3. Add the following code to `umbraco-package.json`:

{% code title="umbraco-package.json" lineNumbers="true" %}

```typescript
{
"$schema": "../../umbraco-package-schema.json",
Expand All @@ -47,6 +48,7 @@ Below you can find an example of how to setup a Header App using the manifest fi
]
}
```

{% endcode %}

* First we define the type which is a `headerApp`. Then we add a unique alias and a name to define the extension UI.&#x20;
Expand All @@ -66,6 +68,7 @@ This is a continuation of the above steps from **Button Header App with Manifest
1. Add a reference to the .js file. Update the `umbraco-package.json` with the following:

{% code title="umbraco-package.json" lineNumbers="true" %}

```typescript
{
"$schema": "../../umbraco-package-schema.json",
Expand All @@ -77,7 +80,7 @@ This is a continuation of the above steps from **Button Header App with Manifest
"alias": "My.HeaderApp",
"name": "My Header App",
"kind": "button",
"js": "/App_Plugins/header-app/dist/header-app.js",
"element": "/App_Plugins/header-app/dist/header-app.js",
"meta": {
"label": "Hello Umbraco",
"icon": "icon-hearts",
Expand All @@ -87,11 +90,13 @@ This is a continuation of the above steps from **Button Header App with Manifest
]
}
```

{% endcode %}

2. Replace the content of the `src/my-element.ts file` with the following:

{% code title="my-element.ts" lineNumbers="true" %}

```typescript
import { ManifestHeaderAppButtonKind, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';

Expand All @@ -109,6 +114,7 @@ const manifest: ManifestHeaderAppButtonKind = {

umbExtensionsRegistry.register(manifest);
```

{% endcode %}

3. In the `header-app` folder run `npm run build` and then run the project. Then in the backoffice you will see our new Header App extension with **address book** **icon**:
Expand Down
Loading