contaobayern/contao-member-contact-settings
Composer 安装命令:
composer require contaobayern/contao-member-contact-settings
包简介
Member contact settings extension for Contao Open Source CMS
README 文档
README
Member contact settings extension for Contao Open Source CMS
Overview
This module enhances the core modules Registration and MemberData by adding fields that
control the allowed contact settings for the registered frontend user.
Installation via Composer
Search package contaobayern/contao-member-contact-settings and install as usual.
For Contao 4.4.x use the Contao Manager to install the extension.
Manual Installation
- Download the files from the GitHub repository. Rename the folder to
member-contact-settingsand save undersystem/modules. - Update your database and clear the internal cache.
Please note
This module's JavaScript will not work with table layouts (i.e. if "Tableless layout" is not checked in the module's definition). This applies to Contao 3 only, as Contao 4 only has templates for tableless layouts. So if you want to use this extension with table layouts you must uncheck the "Control field dependencies with JavaScript" option in your registration and personal data frontend modules.
Setup
The setup is the same for both frontend modules (registration and member data):
- Create a new frontend module of the type "registration" or "member data".
- Define the form as usual.
- With the new fields you can add dependencies. For example if you add "contactPhone" the field "phone" will become mandatory when the user checks "contactPhone". A list of all dependencies is given below.
- Sort the field as you wish. It makes sense to put the dependent fields right below the field from which they depend.
- By default field dependencies are controlled on client side via JavaScript (jQuery must be enabled in page layout). If you do not want to use JavaScript setting of mandatory status you can uncheck the according option.
- With the "Toggle visibility of dependent fields" option you can choose if depedent fields shall be hidden when they are not mandatory (can only be used with JavaScript enabled).
New fields and dependencies in tl_member
| Field | Dependencies |
|---|---|
| contactEmail | - |
| contactLetter | street, postal, city, country |
| contactPhone | phone |
| contactFax | fax |
Adding your own dependencies
Dependencies are defined in the tl_member DCA. In the eval array of each field which has dependencies
there is a new entry dependents:
$GLOBALS['TL_DCA']['tl_member']['fields']['contactLetter'] = [ // ... 'eval' => [ // ... 'dependents' => [ 'mandatory' => ['street', 'postal', 'city', 'country'], 'visibility' => ['street', 'postal', 'city', 'country'], ], // ... ] ]
The array mandatory contains the names of the fields which shall be set to mandatory when the parent
field is checked. The array visibility contains the names of the fields which shall be shown or hidden
according to the parent field.
You can add or modify dependencies in the system\config\dcaconfig.php file.
For example if you want to add state to the dependencies of contactLetter. You can do so by adding
the following code to system\config\dcaconfig.php:
$GLOBALS['TL_DCA']['tl_member']['fields']['contactLetter']['eval']['dependents']['mandatory'][] = 'state'; $GLOBALS['TL_DCA']['tl_member']['fields']['contactLetter']['eval']['dependents']['visibility'][] = 'state';
You can also create new dependencies for your own fields wherever you need them:
$GLOBALS['TL_DCA']['tl_member']['fields']['myCheckbox']['eval']['dependents'] = [ 'mandatory' => ['fieldA', 'fieldB', 'fieldC'], 'visibility' => ['fieldA', 'fieldB', 'fieldC'], ];
Attention: a field which is mandatory by default should not be put in any dependents list. Otherwise its mandatory status will be controlled by the parent field which is unwanted because the field should always be mandatory.
contaobayern/contao-member-contact-settings 适用场景与选型建议
contaobayern/contao-member-contact-settings 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 148 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 07 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「registration」 「member」 「contao」 「mandatory fields」 「dependent fields」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 contaobayern/contao-member-contact-settings 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 contaobayern/contao-member-contact-settings 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 contaobayern/contao-member-contact-settings 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Contao Open Source CMS
User handling for PHP applications.
Users management for Symfony projects.
Laravel Authentication package with built-in two-factor (Authy) and social authentication (Socialite).
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
Adds username authentication and username or email login to a silverstripe install
统计信息
- 总下载量: 148
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2017-07-14