Enables membership functionality Craft Starter.
Proof of Concept only
This plugin requires Craft CMS 4.3.x or later, and PHP 8.0.2 or later.
Latest version of Craft 4 Starter must be installed.
Update composer.json
{
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "vcs",
"url": "https://github.com/wsydney76/craft-members"
}
]
}
Open your terminal and run the following commands:
# go to the project directory
cd /path/to/my-project.test
# tell Composer to load the plugin
composer require wsydney76/craft-members
# tell Craft to install the plugin
craft plugin/install members
Tbd.
Currently, this plugin assumes that there are two sites: en
and de
.
This is the case with a fresh installation of the starter.
Add to config/general.php
:
// The URI Craft should use for user login on the front end.
->loginPath([
'de' => 'mitglieder/login',
'en' => 'members/login'
])
// The URI or URL that Craft should use for Set Password forms on the front end.
->setPasswordPath([
'de' => 'mitglieder/passwort-vergeben',
'en' => 'members/set-password',
])
// The URI that users without access to the control panel should be redirected to after activating their account.
->activateAccountSuccessPath([
'de' => 'mitglieder',
'en' => 'members',
])
// The URI Craft should redirect to when user token validation fails
->invalidUserTokenPath([
'de' => 'mitglieder/ungueltig',
'en' => 'members/invalid',
])
Other recommended settings:
// Whether Craft should set users’ usernames to their email addresses, rather than let them set their username separately.
->useEmailAsUsername(false)
// By default, Craft requires a front-end “password” field for public user registrations.
// Setting this to true removes that requirement for the initial registration form.
->deferPublicRegistrationPassword(true)
// Whether users should automatically be logged in after activating their account or resetting their password.
->autoLoginAfterAccountActivation(true)
- Create a
members
user group. - In
settings
, checkAllow pulic registration
and selectmembers
as 'Default User Group'. - In the plugins settings, enter a custom template path. This template display member specific content on the 'members' page.
Run craft members/seed
Better matching texts for notification emails are prepared in ./vendor/wsydney76/craft-members/translations
. Copy them to the translations
folder of your project.
Add to content
in tailwind.config.js
:
'./vendor/wsydney76/craft-members/src/templates/**/*.twig'
Run npm run build
.