xiaohutai / bolt-isuseful

[Bolt Extension] Add a simple "Is this page useful?" to pages
https://market.bolt.cm/view/twokings/is-useful
1 stars 1 forks source link
bolt bolt-cms bolt-extension feedback

Is Useful Extension

This is a simple extension that adds the feature to add a "Is this page useful? Yes No" to your pages. It has two modes:

For link mode, you can get the url parameter from the query string.

For boltforms mode, you need to add a form named feedback and set ajax to true. An example form as follows:

feedback:
    submission:
        ajax: true
    notification:
        enabled: true
        # debug: true
        # debug_address:
        # debug_smtp: true
        subject: Feedback
        from_name: no-reply@example.com
        from_email: no-reply@example.com
        to_name: Example
        to_email: info@example.com
    feedback:
        success: Success
        error: Error
    fields:
        message:
            type: textarea
            options:
                required: false
                label: Feedback
                attr:
                    placeholder: How should we improve this page?
                    class: message
        url:
            type: hidden
            options:
                label: URL
                required: false
                attr:
                    class: hidden
        type:
            type: hidden
            options:
                label: Type
                required: false
                attr:
                    class: hidden
        id:
            type: hidden
            options:
                label: ID
                required: false
                attr:
                    class: hidden
        submit:
            type: submit
            options:
                label: Send
                attr:
                    class: button primary

In your template add:

{{ include('@is_useful/_is_useful.twig') }}

Or copy the twig file to your theme, customize it and include that file.

Ideas and Thoughts