generated from AdobeDocs/dev-site-documentation-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added "Navigation - AEM Content Fragments Console Extensibility" page
- Loading branch information
Showing
7 changed files
with
89 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/pages/services/aem-cf-console-admin/api/navigation/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
Binary file added
BIN
+168 KB
...ervices/aem-cf-console-admin/api/navigation/navigation.admin.open_in_editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes