piedweb/conversation

此包已被废弃,不再维护。作者建议使用pushword/core包。

PiedWeb/CMS的对话扩展

安装: 27

依赖项: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

公开问题: 0

类型:symfony-bundle

dev-master / 0.x-dev 2020-12-09 16:50 UTC

This package is auto-updated.

Last update: 2022-02-24 23:59:32 UTC


README

conversation static website

对话

Latest Version Software License Build Status Quality Score Code Coverage Total Downloads

通过添加评论联系表单或简单的用户输入扩展页面...

在静态网站上添加对话。

最初开发用于与PiedWeb/CMS一起使用。

安装

通过Packagist

# Get the Bundle
composer require piedweb/conversation

# Add the route to your Routes:
conversation:
    resource: '@PiedWebConversationBundle/Resources/config/routes/conversation.yaml'

更新sonata_admin配置文件以添加导航链接

        groups:
            app.admin.group.page:
                label: admin.label.content
                label_catalogue: messages
                items:
                    - piedweb.admin.page
                    - piedweb.admin.media
                    - piedweb.admin.conversation

(或 ln -s -f vendor/piedweb/cms-bundle/src/Resources/config/packages/sonata_admin.fullFeatured.yaml config/packages/sonata_admin.yaml)

用法

您可以直接使用它并将它以两种方式包含在您的页面中

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

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

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

使用激活data-live元素

import { liveForm } from "piedweb-cms-js-helpers/src/helpers";

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

### Render published comment

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

获取新消息的邮件通知

配置包(piedweb_conversation.notification_emailTo)并编程cron

bin/console conversation:notify

自定义

小渲染自定义

通过覆盖@PiedWebConversation/_conversation.html.twig(或'@PiedWebConversation/_'.$type.'Step'.$step.'.html.twig'@PiedWebConversation/_'.$type.$referring.'Step'.$step.'.html.twig)。

创建新表单

默认情况下,有3种表单类型:newslettermessagemultiStepMessage

在配置中添加新类 piedweb_conversation.form.myNewType: myNewFormClass

待办事项

  • 测试
  • 从默认视图文件中删除bootstrap类(通过将它们移动到PiedWebThemeComponent)
  • 新消息的电子邮件验证器

贡献者

许可

MIT(有关详细信息,请参阅LICENSE文件)