Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Bähr committed Sep 28, 2023
1 parent 20546b0 commit 08b6454
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
38 changes: 34 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,42 @@
Adds new console command to spryker, which uses the imported category data to generate a navigation_node.csv based on the category-tree.

## Usage:
1. Register console command: add `NavigationGeneratorConsole` to `Pyz\Zed\Console\ConsoleDependencyProvider::getConsoleCommands()`
1. Add `NavigationGeneratorConsole` to `Pyz\Zed\Console\ConsoleDependencyProvider::getConsoleCommands()`
```
<?php
namespace Pyz\Zed\Console;
[...]
use Pyz\Zed\NavigationGenerator\Communication\Console\NavigationGeneratorConsole;
class ConsoleDependencyProvider extends SprykerConsoleDependencyProvider
{
/**
* @param \Spryker\Zed\Kernel\Container $container
*
* @return array<\Symfony\Component\Console\Command\Command>
*/
protected function getConsoleCommands(Container $container): array
{
$commands = [
[...]
new NavigationGeneratorConsole(),
];
return $commands;
}
}
```
2. Run command:
```
vendor/bin/console data:generate:navigation-node
```
## Configuration:
* `NavigationGeneratorConstants::OUTPUT_PATH` (Default: `APPLICATION_ROOT_DIR . '/data/import/common/common/navigation_node.csv'`)
* `NavigationGeneratorConstants::FALLBACK_LOCALE` (Default: `de_DE`, is used when for a configured locale no category data is available)
* `NavigationGeneratorConstants::NAVIGATION_KEY` (Default: `MAIN_NAVIGATION`)
* `NavigationGeneratorConstants::OUTPUT_PATH`
* Default: `APPLICATION_ROOT_DIR . '/data/import/common/common/navigation_node.csv'`
* `NavigationGeneratorConstants::FALLBACK_LOCALE`
* Default: `de_DE`
* Is used when for a configured locale no category data is available
* `NavigationGeneratorConstants::NAVIGATION_KEY`
* Default: `MAIN_NAVIGATION`
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "valantic-spryker/navigation-generator",
"type": "library",
"description": "Generates navigation-node.csv based on imported category data",
"license": "proprietary",
"require": {
"php": ">=8.0",
"spryker/kernel": "^3.0.0",
Expand Down

0 comments on commit 08b6454

Please sign in to comment.