Download the PHP package contaobayern/contao-member-contact-settings without Composer
On this page you can find all versions of the php package contaobayern/contao-member-contact-settings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download contaobayern/contao-member-contact-settings
More information about contaobayern/contao-member-contact-settings
Files in contaobayern/contao-member-contact-settings
Package contao-member-contact-settings
Short Description Member contact settings extension for Contao Open Source CMS
License LGPL-3.0-or-later
Informations about the package contao-member-contact-settings
Contao Member Contact Settings
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-settings
and 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
:
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
:
You can also create new dependencies for your own fields wherever you need them:
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.
All versions of contao-member-contact-settings with dependencies
contao/core-bundle Version ~3.5 || ~4.4
contao-community-alliance/composer-plugin Version ~2.4 || ~3.0