Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown item: support dialog and drawer props from buttons #6872

Open
soerenengels opened this issue Dec 17, 2024 · 1 comment
Open

Dropdown item: support dialog and drawer props from buttons #6872

soerenengels opened this issue Dec 17, 2024 · 1 comment
Labels
type: enhancement ✨ Suggests an enhancement; improves Kirby
Milestone

Comments

@soerenengels
Copy link
Contributor

Description

I want to extend an area with a dropdown and drawer definition. As I expected the following to work, I could not get the drawer to open from a PHP defined dropdown with drawer key as shown below. dialog is working for me. At Discord an alternative with a drawers/ prefixed link was proposed, that is working for me, but seems inconsistent.

[
  'pattern' => 'example/dropdown',
  'action'  => function () {
    return [
      [
        'text'   => 'Example link',
        'icon'   => 'link',
	'link' => 'https://getkirby.com/', // Works
      ],
      [
        'text'   => 'Example Dialog',
	'icon'   => 'chat',
	'dialog' => 'route/to/dialog', // Works
      ],
      [
        'text'   => 'Example Drawer (Expected behavior)',
	'icon'   => 'open',
	'drawer' => 'route/to/drawer', // Doesn't work
      ],
      [
        'text'   => 'Example Drawer (working)',
	'icon'   => 'open',
	'link' => 'drawers/route/to/drawer', // Works
      ],
    ];
  }
]

Expected behavior
Consistent keys in dropdown/button definition. Either prefixed link or additionally dialog AND drawer working.
More precise documentation

Your setup

Kirby Version
5.0.0-beta.1

Console output
The console is empty.

@distantnative distantnative changed the title [v5] Inconsistent PHP option definitions (?) Dropdown item: support dialog and drawer props from buttons Dec 17, 2024
@distantnative distantnative added the type: enhancement ✨ Suggests an enhancement; improves Kirby label Dec 17, 2024
@distantnative distantnative added this to the 5.0.0-beta.2 milestone Dec 17, 2024
@distantnative
Copy link
Member

Currently, I am less confused why drawer isn't working yet, but why dialog would be working already. Doubting my solution is right then, somewhere dialog needs to be supported already if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement ✨ Suggests an enhancement; improves Kirby
Projects
None yet
Development

No branches or pull requests

2 participants