An open API service indexing awesome lists of open source software.

https://github.com/gearsdigital/enhanced-toolbar-link-dialog

Extend Kirby's default link dialog with search functionality, allowing you to easily create links to existing or external pages at your fingertips.
https://github.com/gearsdigital/enhanced-toolbar-link-dialog

kirby kirby-cms kirby-panel kirby3-plugin php

Last synced: 7 months ago
JSON representation

Extend Kirby's default link dialog with search functionality, allowing you to easily create links to existing or external pages at your fingertips.

Awesome Lists containing this project

README

          

# Enhanced Toolbar Link Dialog

![Kirby](https://img.shields.io/badge/Kirby-%3E=3.6-brightgreen.svg)
![Version](https://img.shields.io/github/v/release/gearsdigital/enhanced-toolbar-link-dialog?label=Version&color=4CC61E&logo=github)
![E2E](https://github.com/gearsdigital/enhanced-toolbar-link-dialog/workflows/E2E/badge.svg)
![Downloads](https://img.shields.io/packagist/dt/gearsdigital/enhanced-toolbar-link-dialog?label=Downloads)
![PHP 8.0](https://img.shields.io/badge/php-8.1-brightgreen.svg?color=8892BF&logo=php)

This plugin extends the default link dialog with search functionality, making it possible to create links to _existing_ or _external_ pages.

## Configuration

These are all available configuration options and their default values.

| Option | Description | Type | Default |
|----------------|-----------------------------------------------------------------------------------------------------------------------------------|-----------|--------------------|
| `title` | Format the page title of the result list using [Kirby Query Language](https://getkirby.com/docs/guide/blueprints/query-language). | `string` | `{{ page.title }}` |
| `filter` | Filter the result list. Learn how to use [`filterBy`](https://getkirby.com/docs/reference/objects/toolkit/collection/filter-by). | `array` | `null` |
| `sort` | Sort the result list. Learn how to use [`sortBy`](https://getkirby.com/docs/reference/objects/toolkit/collection/sort-by). | `array` | `null` |
| `qualified` | Prefix every link with your current [Site-Url](https://getkirby.com/docs/reference/objects/cms/site/url). | `boolean` | `false` |
| `translations` | [Override plugin translations](#localization). | `array` | `[]` |
| `target-field` | By setting `hidden`, the field will be hidden. Setting `disabled` will disable the field but keep it visible. | `string` | |
| `anchor-field` | By setting `hidden`, the field will be hidden. Setting `disabled` will disable the field but keep it visible. | `string` | |

### Usage

```php
// site/config/config.php
return [
"gearsdigital.enhanced-toolbar-link-dialog" => [
"title" => "{{ page.title }}",
"filter" => null,
"sort" => null,
"qualified" => false,
"translations" => [],
"anchor-field" => 'hidden',
"target-field" => disabled,
]
];
```

## Installation

### Composer (recommended)

```
composer require gearsdigital/enhanced-toolbar-link-dialog
```

### Download

Download the [latest version](https://github.com/gearsdigital/enhanced-toolbar-link-dialog/releases/latest), copy all files to `/site/plugins/enhanced-toolbar-link-dialog`.

### Git submodule

```
git submodule add https://github.com/gearsdigital/enhanced-toolbar-link-dialog.git site/plugins/enhanced-toolbar-link-dialog
```

## FAQ

Can I use this plugin with Kirby Blocks?

Starting from version 3.0.0, Blocks are supported, and it also works seamlessly with default textareas.

Can I link to different sites?

Yes, absolutely. Just write (or paste) the URL into the Link field.

Can I create anchor-only links?

If you want to jump to a specific part of the page you're currently editing, you can create anchor-only links by leaving the Link field empty and filling in the Anchor field.

Can I customize the result list page title?

Yes, you can use the title option to customize the title according to your needs using the Kirby Query Language.

Within a query, you have access to page, site, and kirby objects. For example, setting 'title' => '{{ page.title }} [{{ page.parent.title }}]' will display the title as 'Mountains [Photography]'.

Can I show only pages that match some specific criteria?

Certainly! By setting "filter"=> ['status', 'listed'], only listed pages will be displayed. You can study the
Filtering compendium
to learn more about filtering collections in Kirby.

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## Localization

This is the list of all available translation keys:

| Key | Value |
|---------------------------------------------------------------------------|-----------------------------|
| `gearsdigital.enhanced-toolbar-link-dialog.anchor.title` | Anchor |
| `gearsdigital.enhanced-toolbar-link-dialog.field.autosuggest.placeholder` | Enter a URL or search termโ€ฆ |

You can override translations by adding this to your site config.

```php
// site/config/config.php
return [
"gearsdigital.enhanced-toolbar-link-dialog" => [
"translations" => [
"en" => [
"gearsdigital.enhanced-toolbar-link-dialog.autosuggest.placeholder" => "I'm overridden!",
],
],
]
]
```

### Available languages

- English (default)
- German ๐Ÿ‡ฉ๐Ÿ‡ช
- French ๐Ÿ‡ซ๐Ÿ‡ท
- Dutch ๐Ÿ‡ณ๐Ÿ‡ฑ
- Danish ๐Ÿ‡ฉ๐Ÿ‡ฐ
- Norwegian ๐Ÿ‡ณ๐Ÿ‡ด
- Swedish ๐Ÿ‡ธ๐Ÿ‡ช
- Islandic ๐Ÿ‡ฎ๐Ÿ‡ธ

## License

[MIT](https://choosealicense.com/licenses/mit/)