plain-solutions-gmbh / kirby-form-block-suite

This form plugin for Kirby offers you maximum flexibility and usability. It can be used as a block anywhere you needed. This repository replaces the obsolete version 2.0.
Other
38 stars 11 forks source link

Question: can I set different submit button text for different forms #51

Closed brandsis closed 4 months ago

brandsis commented 4 months ago

I'm in the process of migrating a charity client's website (from MODX) to Kirby. There are two pages with forms – a simple contact form and an application form for funding grants – that I need to replicate using Form Block Suite.

However, as the submit button text is controlled through translations in config.php, is there a way that I can specify different button text for the different forms? For example, "Send message" and "Submit application".

This is my current config entry...

    'microman.formblock' => [
        'from_email' => ["form@brandsistency.com" => "Brandsistency website"],
        'translations' => [
            'en' => [
                'send_button' => 'Send message',
                'loading' => 'Send message'
            ]
        ]
    ],
plain-solutions-gmbh commented 4 months ago

Yes you can do it with messages. Use Extend option In options, you can create a text field named send_button

brandsis commented 4 months ago

Thanks, Roman. I thought I might have missed it in the docs. I'll give it a try.

If I create custom fields for send_button and loading, will they automatically get picked up by the front-end snippets/templates based on field name? (The instructions only refer to blueprints.)

plain-solutions-gmbh commented 4 months ago

It is a blueprint. You will have a field in the options tab, where you can enter the text.

site/blueprints/snippets/form_options.yml

send_button:
  label: My custom button text
  type: text
Bildschirmfoto 2024-04-30 um 11 33 35
brandsis commented 4 months ago

Thanks, Roman. I've done that successfully.