Conversation

Extend your Pushword website with comments, a contact form or just an user input.

Install

Via Packagist :

# Get the Bundle
composer require pushword/conversation

That's it ! If you have a custom installation (not used the default installer), you may have a look inside vendor/pushword/admin/install.php.

Usage

You can use it as is and include it in your Page with two manners :

# Load form via fetch (javascript)
<div data-live="{{ conversation('newsletter') }}"></div>
# =
<div data-live="{{ path('pushword_conversation', {'type': 'newsletter', 'referring': 'newsletter-'~page.slug, 'host': page.host}) }}"></div>

# Render form in Controller
{{ render(controller('Pushword\\Conversation\\Controller\\ConversationFormController::show')) }}

# Or add a button to click before loading block
<button src-data-live="{{ path('pushword_conversation', {'type': 'newsletter', 'referring': 'nslttr-'~page.slug, 'host': page.host}) }}" class="btn btn-primary">Register</button>

Activate the data-live element with @pushword/js-helper :

import { liveForm } from "@pushword/js-helper/src/helpers";

// on dom changed and on page loaded&nbsp;:
liveBlock();
```

### Render published comment

```twig
{{ showConversation(referring[, orderBy, limit, template]) }}

Get mail notification for new message

Configure the bundle directly in app configuration

    conversation_notification_email_to: "example@example.tld",
    conversation_notification_email_from: "example@example.tld",
    conversation_notification_interval: "PT1S" #each 1s, default 1 time per day

Customization

Small rendering customization

By overriding @PushwordConversation/conversation/conversation.html.twig (or '@PushwordConversation/conversation/'.$type.'Step'.$step.'.html.twig or '@PushwordConversation/conversation/'.$type.$referring.'Step'.$step.'.html.twig).

Create a new form

Per default, there is 3 form types : newsletter, message and multiStepMessage.

Add a new class in config piedweb_conversation.form.myNewType: myNewFormClass.