Skip to content

Add option to Inputfield header action functions to add custom class to action button #542

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

Open
Toutouwai opened this issue Sep 20, 2024 · 1 comment

Comments

@Toutouwai
Copy link

Short description of the enhancement

There are JS and PHP functions for adding Inputfield header action buttons, most recently mentioned in this announcement: https://processwire.com/talk/topic/30226-weekly-update-%E2%80%93%C2%A019-july-2024/

This request is to add an option that allows a custom class to be added to an action button (icon), so that it can be targeted in custom CSS and JS.

So that you could do something like this:

$inputfield->addHeaderAction([
    'icon' => 'question-circle',
    'href' => $this->wire()->config->urls->root . "admin-docs/?id=$doc_id",
    'class' => 'my-custom-action',
]);

...and get markup like this...

2024-09-20_203402

@Toutouwai
Copy link
Author

It would also be good to be able to add custom data attributes to the buttons - more important than classes actually, because if custom data attributes were possible we could always target icons via data attribute in CSS and JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant