-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd9a2fe
commit bccab95
Showing
8 changed files
with
823 additions
and
629 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
dist |
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 |
---|---|---|
@@ -1,22 +1,26 @@ | ||
> ### This extension is in development and most probably will have file structure change when Directus 9 official releases. Meanwhile breaking changes are possible in anytime. | ||
# WP Slug Interface | ||
|
||
WordPress alike slug/permalink interface | ||
|
||
![](https://raw.githubusercontent.com/dimitrov-adrian/directus-extension-wpslug-interface/main/screenshot.png) | ||
|
||
## Installation | ||
|
||
In your Directus installation root | ||
|
||
```bash | ||
npm install dimitrov-adrian/directus-extension-wpslug-interface | ||
npm install directus-extension-wpslug-interface | ||
``` | ||
|
||
Restart directus | ||
|
||
|
||
## How to use | ||
|
||
1. Create new standard field with String type | ||
2. For interface select **Slug** | ||
|
||
## FAQ | ||
|
||
### Does this works when performing changes throught the API | ||
|
||
No, this is just an interface. It works only on Directus App |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "directus-extension-wpslug-interface", | ||
"version": "1.0.0-beta.3", | ||
"version": "1.0.0", | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "Adrian Dimitrov" | ||
|
@@ -28,11 +28,11 @@ | |
"build": "directus-extension build" | ||
}, | ||
"devDependencies": { | ||
"@directus/extensions-sdk": "^9.0.0-rc.98", | ||
"@directus/extensions-sdk": "^9.2.1", | ||
"@sindresorhus/slugify": "^2.1.0", | ||
"eslint-config-prettier": "8.3.0", | ||
"eslint-plugin-prettier": "4.0.0", | ||
"eslint-plugin-vue": "7.19.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"eslint-plugin-vue": "^8.2.0", | ||
"micromustache": "^8.0.3", | ||
"prettier": "^2.4.1", | ||
"stylelint-config-prettier": "^8.0.2", | ||
|
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 |
---|---|---|
@@ -1,13 +1,100 @@ | ||
import { defineInterface } from '@directus/shared/utils'; | ||
import { InterfaceConfig } from '@directus/shared/types'; | ||
import InterfaceSlug from './slug.vue'; | ||
import Options from './options.vue'; | ||
|
||
export default defineInterface({ | ||
id: 'directus-extension-wpslug-interface', | ||
export default { | ||
id: 'extension-wpslug', | ||
name: 'Slug', | ||
description: 'WordPress alike slug/permalink interface', | ||
icon: 'link', | ||
component: InterfaceSlug, | ||
types: ['string'], | ||
options: Options, | ||
}); | ||
group: 'standard', | ||
options: ({ collection }) => { | ||
return [ | ||
{ | ||
field: 'placeholder', | ||
name: '$t:placeholder', | ||
meta: { | ||
width: 'full', | ||
interface: 'input', | ||
options: { | ||
placeholder: '$t:enter_a_placeholder', | ||
}, | ||
}, | ||
}, | ||
{ | ||
field: 'template', | ||
type: 'string', | ||
name: '$t:template', | ||
meta: { | ||
width: 'full', | ||
interface: 'system-display-template', | ||
required: true, | ||
options: { | ||
collectionName: collection, | ||
font: 'monospace', | ||
placeholder: '{{ title }}-{{ id }}', | ||
}, | ||
}, | ||
}, | ||
{ | ||
field: 'iconLeft', | ||
name: '$t:icon_left', | ||
type: 'string', | ||
meta: { | ||
width: 'half', | ||
interface: 'select-icon', | ||
}, | ||
}, | ||
{ | ||
field: 'prefix', | ||
type: 'string', | ||
name: '$t:prefix', | ||
meta: { | ||
width: 'full', | ||
interface: 'system-display-template', | ||
required: true, | ||
options: { | ||
collectionName: collection, | ||
font: 'monospace', | ||
placeholder: 'http://example.com/', | ||
}, | ||
}, | ||
}, | ||
{ | ||
field: 'suffix', | ||
type: 'string', | ||
name: '$t:suffix', | ||
meta: { | ||
width: 'full', | ||
interface: 'system-display-template', | ||
required: true, | ||
options: { | ||
collectionName: collection, | ||
font: 'monospace', | ||
placeholder: '/', | ||
}, | ||
}, | ||
}, | ||
{ | ||
field: 'update', | ||
name: '$t:update', | ||
type: 'json', | ||
meta: { | ||
width: 'half', | ||
interface: 'select-multiple-checkbox', | ||
default_value: 'normal', | ||
options: { | ||
choices: [ | ||
{ text: '$t:on_create', value: 'create' }, | ||
{ text: '$t:on_update', value: 'update' }, | ||
], | ||
}, | ||
}, | ||
schema: { | ||
default_value: '[]', | ||
}, | ||
}, | ||
]; | ||
}, | ||
} as InterfaceConfig; |
This file was deleted.
Oops, something went wrong.
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