Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

wsydney76/craft-members

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Members

Enables membership functionality Craft Starter.

Proof of Concept only

Requirements

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.

Installation

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

Prepare

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)

Settings

  • Create a members user group.
  • In settings, check Allow pulic registration and select members as 'Default User Group'.
  • In the plugins settings, enter a custom template path. This template display member specific content on the 'members' page.

Create pages

Run craft members/seed

Notification Emails

Better matching texts for notification emails are prepared in ./vendor/wsydney76/craft-members/translations. Copy them to the translations folder of your project.

CSS

Add to content in tailwind.config.js:

'./vendor/wsydney76/craft-members/src/templates/**/*.twig'

Run npm run build.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published