Extend your Pushword website with comments, a contact form or just an user input.
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
.
# 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 :
liveBlock();
```
### Render published comment
```twig
{{ showConversation(referring[, orderBy, limit, template]) }}
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
By overriding @PushwordConversation/conversation/conversation.html.twig
(or '@PushwordConversation/conversation/'.$type.'Step'.$step.'.html.twig
or '@PushwordConversation/conversation/'.$type.$referring.'Step'.$step.'.html.twig
).
Per default, there is 3 form types : newsletter
, message
and multiStepMessage
.
Add a new class in config piedweb_conversation.form.myNewType: myNewFormClass
.