Skip to content

Commit

Permalink
Added "Navigation - AEM Content Fragments Console Extensibility" page
Browse files Browse the repository at this point in the history
  • Loading branch information
naydav committed Aug 22, 2023
1 parent 827fa5c commit b10a50a
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 2 deletions.
4 changes: 4 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ module.exports = {
title: "Header Menu",
path: "/services/aem-cf-console-admin/api/header-menu/"
},
{
title: "Navigation",
path: "/services/aem-cf-console-admin/api/navigation/"
}
]
},
{
Expand Down
8 changes: 8 additions & 0 deletions src/pages/services/aem-cf-console-admin/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ Learn how to extend and customize Action Bar

Learn how to customize Grid Columns

<DiscoverBlock slots="link, text"/>

[Header Menu](header-menu)

Explore the ways to extend and customize Header Menu

<DiscoverBlock slots="link, text"/>

[Navigation](navigation)

Learn how to use basic methods for navigating within an extension
67 changes: 67 additions & 0 deletions src/pages/services/aem-cf-console-admin/api/navigation/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Navigation - AEM Content Fragments Console Extensibility
description: Learn about navigation host API methods that can be used in any extension
contributors:
- https://github.com/AdobeDocs/uix
---

# Navigation

Describes basic methods for navigating within an extension.

## API to open Content Fragment from an extension

<InlineAlert variant="warning" slots="text" />

The Content Fragment will only open in the headless editor if the `AemFeatures.ACTION_OPEN_NEW_EDITOR` feature is enabled for the AEM instance.

```js
import { useEffect } from "react";
import { Text } from "@adobe/react-spectrum"
import { extensionId } from "./Constants"
import { register } from "@adobe/uix-guest";

function ExtensionRegistration() {
useEffect(() => {
const init = async () => {
const registrationConfig = {
id: extensionId,
methods: {
actionBar: {
getButtons() {
return [
{
id: "example.open_in_editor",
label: "UIX Open In Editor",
icon: 'Export',
variant: "primary",
onClick: (selections) => {
console.log("UIX Open In Editor has been pressed.");
console.log(selections[0].id);
// or any other content fragment path

guestConnection.host.navigation.openEditor(selections[0].id);
},
},
];
},
},
},
};
const guestConnection = await register(registrationConfig);
}
init().catch(console.error)
}, []);
return <Text>IFrame for integration with Host (AEM)...</Text>
}

export default ExtensionRegistration;
```

![](./navigation.admin.open_in_editor.png)

**API Reference**

| Field | Type | Required | Default | Description |
|------------------------|-----------|--------|-----------|-------------------------------------------------------|
| fragmentPath | `string` | ✔️ | | The path of the CF to be open. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/pages/services/aem-cf-editor/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,26 @@ Learn how to extend and customize Rich Text Editor Toolbar

Learn how to customize Rich Text Editor Widgets

<DiscoverBlock slots="link, text"/>

[Rich Text Editor Badges](rte-badges)

Learn how to customize Rich Text Editor Badges

<DiscoverBlock slots="link, text"/>

[Rich Text Editor Color Picker](rte-colorpicker)

Learn how to customize Rich Text Editor Color Picker

<DiscoverBlock slots="link, text"/>

[Header Menu](header-menu)

Explore the ways to extend and customize Header Menu

<DiscoverBlock slots="link, text"/>

[Navigation](navigation)

Learn how to use basic methods for navigating within an extension
4 changes: 2 additions & 2 deletions src/pages/services/aem-cf-editor/api/navigation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Describes basic methods for navigating within an extension.

<InlineAlert variant="warning" slots="text" />

The Content Fragment will only open in the headless editor if the AemFeatures.ACTION_OPEN_NEW_EDITOR feature is enabled for the AEM instance.
The Content Fragment will only open in the headless editor if the `AemFeatures.ACTION_OPEN_NEW_EDITOR` feature is enabled for the AEM instance.

```js
import { useEffect } from "react";
Expand Down Expand Up @@ -59,7 +59,7 @@ function ExtensionRegistration() {
export default ExtensionRegistration;
```

![](./navigation.open_in_editor.png)
![](./navigation.editor.open_in_editor.png)

**API Reference**

Expand Down

0 comments on commit b10a50a

Please sign in to comment.