Dominik
November 11, 2019, 11:20am
1
Hi there!
We are big fans of Kirby and want to (ab-)use Kirby as a Voice CMS for an Alexa Skill.
All works really well but we need some extension to existing Textareas (only available in the backend):
I need a Button above the Textarea
Once clicked it will execute a JavaScript
This JavaScript should receive the contents of the textarea
JavaScript is executed (Text is read to User - “Prelisten”)
Thats it. No need to submit or do anything with the textarea value at this point
Is this doable?
I looked at fields and plugins but i found it really php reliant and no examples of JavaScript execution on a Button click.
Thanks a lot for your help!!
texnixe
November 11, 2019, 11:40am
2
A custom section would probably be a solution rather than a field (if it can be independent of the textarea field itself).
There’s always a little bit of PHP involved to create a section, but if you only need the wrapper if you don’t have to pass data between the frontend and backend I guess (not too familiar with Panel stuff).
Dominik
November 11, 2019, 3:11pm
3
Ok! That sounds like a plan! Any idea how i can access the field value in the java script code?
@Dominik you can use our newly refactored and documented content store: https://getkirby.com/docs/reference/plugins/internals/store-content
You can get any field of your page in any of your section plugins.