Skip to content

Commit

Permalink
docs: Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
cyp3rius committed Apr 12, 2023
1 parent dfcc5c8 commit faaf81c
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ Strapi Navigation Plugin provides a website navigation / menu builder feature fo
9. [🕸️ Public API specification](#%EF%B8%8F-public-api-specification)
- [REST API](#rest-api)
- [GraphQL API](#graphql-api)
10. [💬 FAQ](#-faq)
11. [🤝 Contributing](#-contributing)
12. [👨‍💻 Community support](#-community-support)
10. [🔌 Extensions](#-extensions)
11. [🧩 Examples](#-examples)
12. [💬 FAQ](#-faq)
13. [🤝 Contributing](#-contributing)
14. [👨‍💻 Community support](#-community-support)

## ✨ Features

Expand Down Expand Up @@ -184,7 +186,6 @@ Config for this plugin is stored as a part of the `config/plugins.js` or `config
- `gql` - If you're using GraphQL that's the right place to put all necessary settings. More **[ here ](#gql-configuration)**
- `i18nEnabled` - should you want to manage multi-locale content via navigation set this value `Enabled`. More **[ here ](#i18n-internationalization)**
- `cascadeMenuAttached` - If you don't want "Menu attached" to cascade on child items set this value `Disabled`.
- `slugify` - allows to extend configuration of our "slugging" solution of choice. To learn more visit the [documentation](https://github.com/sindresorhus/slugify#api). It can be left unset since it's optional. **This option can only be handled by configuration in config file**.

### Properties

Expand Down Expand Up @@ -638,37 +639,16 @@ For collection types it will be read from content type's attribute name `templat

For single types a global name of this content type will be used as a template name or it can be set manually with an option named `templateName`.

## 🧩 Examples

Live example of plugin usage can be found in the [VirtusLab Strapi Examples](https://github.com/VirtusLab/strapi-examples/tree/master/strapi-plugin-navigation) repository.

## 💬 FAQ

### GraphQL tricks

**Q:** I would like to use GraphQL schemas but I'm not getting renderNavigation query or even proper types as Navigation, NavigationItem etc. What should I do?

**A:** **A:** There is a one trick you might try. Strapi by default is ordering plugins by the way which takes `strapi-plugin-graphql` to initialize earlier than other plugins so types might not be injected. If you don't have it yet, please create `config/plugins.js` file and put there following lines (put `graphql` at the end):

```js
module.exports = {
'navigation': { enabled: true },
'graphql': { enabled: true },
};
```

If you already got it, make sure that `navigation` plugin is inserted before `graphql`. That should do the job.
## 🔌 Extensions

### Slug generation

#### Customisation

Slug generation is available as a controller and service. If you have custom requirements outside of what this plugin provides you can add your own logic with [plugins extensions](https://docs.strapi.io/developer-docs/latest/development/plugins-extension.html).

For example:

```ts
// path: ./src/index.js
// path: /admin/src/index.js

module.exports = {
// ...
Expand All @@ -686,6 +666,27 @@ module.exports = {
};
```

## 🧩 Examples

Live example of plugin usage can be found in the [VirtusLab Strapi Examples](https://github.com/VirtusLab/strapi-examples/tree/master/strapi-plugin-navigation) repository.

## 💬 FAQ

### GraphQL tricks

**Q:** I would like to use GraphQL schemas but I'm not getting renderNavigation query or even proper types as Navigation, NavigationItem etc. What should I do?

**A:** **A:** There is a one trick you might try. Strapi by default is ordering plugins by the way which takes `strapi-plugin-graphql` to initialize earlier than other plugins so types might not be injected. If you don't have it yet, please create `config/plugins.js` file and put there following lines (put `graphql` at the end):

```js
module.exports = {
'navigation': { enabled: true },
'graphql': { enabled: true },
};
```

If you already got it, make sure that `navigation` plugin is inserted before `graphql`. That should do the job.

## 🤝 Contributing

<div>
Expand Down

0 comments on commit faaf81c

Please sign in to comment.