Skip to content

Commit

Permalink
Add support for multiple configs to product picker (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
herzog31 authored Oct 8, 2024
1 parent d5788fc commit a6b6505
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 31 deletions.
42 changes: 42 additions & 0 deletions tools/picker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Sidekick Product Picker

## Overview
To facilitate adding commerce references in content authoring, we have created the product picker Sidekick plugin. You can use it to browse your product catalog and copy references and blocks into your documents.

## Setup
* In `index.js`:
* Ensure you updated the references to your project's configuration files.
* Update the block list to match the commerce blocks you're using in your project.
* Run `npm i` and `npm run build` to build the picker.
* Additionally you can run `npm run start` to test changes locally.
* Add the picker to the Sidekick by adjusting the `plugins` array in the `tools/sidekick/config.json` file or via the config API.
```json
// Example
{
//...
"plugins": [
{
"id": "cif",
"title": "Commerce",
"environments": [
"edit"
],
"url": "https://main--aem-boilerplate-commerce--hlxsites.hlx.live/tools/picker/dist/index.html",
"isPalette": true,
"paletteRect": "top: 54px; left: 5px; bottom: 5px; width: 300px; height: calc(100% - 59px); border-radius: var(--hlx-sk-button-border-radius); overflow: hidden; resize: horizontal;"
}
]
}
```

## Usage
* Open any document of your project in SharePoint or Google Docs.
* Open the Sidekick.
* Click the Commerce button to open the picker.
* You can select a config by pressing the settings button and select one. Using your production config is recommended in most cases.
* Select a block in the dropdown field which you want to insert into your document.
* Use the picker to navigate to the category/categories or product(s) which should be used by the block.
* If the block requires multiple references, tick checkboxes of all items you want to select. Then click the copy icon next to the dropdown field.
* If the block requires only a single reference, you can directly click the copy icon next to the item.
* Use Ctrl/Cmd + V to paste the copied block into your document.
* You can close the picker by clicking on the Commerce button again.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Loading

0 comments on commit a6b6505

Please sign in to comment.