Adds a listing of members with detail pages and extends them with an avatar that can be uploaded and deleted
Working with Contao 4.13 and Contao ^5.3 (PHP ^8.1)
The Member extension bunde adds the possibility to display members and their details in lists using frontend modules. The member options are extended with an avatar that can be changed and uploaded in the member edit module and registration module. Additionally, you can display members with their details in a reader page.
- Compatible with Contao 4.13 (PHP ^8.0)
- Extends members with avatars
- Paginated member lists
- Member detail pages
- Insert tags for member avatars
- Sortable data-tables (funded by @netzarbeiter)
- requires jQuery to work (https://datatables.net/)
composer require oveleon/contao-member-extension-bundle
Search for contao member extension bundle and add it to your extensions.
After installing the contao-member-extension-bundle, you need to run a contao install.
This bundle extends contao with the possibiity to extend members with an avatar and displaying members in a list with detail pages.
-
Go into members and set up a default avatar in the newly added settings
-
To display your members, you need to set up a memberlist
- Create the front end module memberlist
- Choose the member groups and the member fields that should be displayed
- Optionally you can set up a redirect page to your memberreader
- Embed the module in a page
-
Displaying the avatar
- Create the front end module Avatar / profile picture
- Optionally you can set an image size
- Embed the module in a page
-
Module to delete an avatar
- Create the front end module Delete Avatar
- Embed the module in a page
- The module only appears if a frontend user is logged in
- You can check the "profile picture option" within registration to enable members to upload a profile picture within registration
-
Member reader page
- Create the front end module memberreader
- Choose the member groups and the member fields that are allowed
Member avatars can be shown using following insert-tags
For more information on Insert tags, please visit the official Contao documentation.
Example
{{avatar::member::current}}
{{avatar::member::current::200x200xproportional}}
{{avatar::member::4}}
{{avatar::member::4::300x300xcrop}}
// Output file url
{{avatar_url::member::current}}
{{avatar_url::member:4}}
The allowed image size parameters are: "width x height x mode"
Size mode (See: Size Array)
- crop
- box
- proportional (Contao 4.13 only)
The standard mode vor avatar insert tags is crop
Member extension avatar | |
---|---|
Insert tag | Description |
{{avatar::member::current}} | Displays the avatar of the logged in member |
{{avatar::member::current::200x300}} | Displays the avatar of the logged in member with a width of 200 and a height of 300 |
{{avatar::member::current::300x400xbox}} | Displays the avatar of the logged in member with a width of 300, a height of 400 and the mode: box |
{{avatar::member::123}} | Displays the avatar of member id 123 |
{{avatar::member::123::200x300}} | Displays the avatar of member id 123 with a width of 200 and a height of 300 |
{{avatar::member::123::300x400xbox}} | Displays the avatar of member id 123 with a width of 300, a height of 400 and the mode: box |
Displays activated members in a list.
Displays a detail page of a member.
Displays an avatar of a member. If no avatar has been uploaded, the default avatar (or the fallback avatar from the bundle) will be shown.
A module that can be embedded into a page that adds the possibility to delete the avatar of a member.
The member extension provides additional options that can be used with programmatic knowledge.
Allows filtering the member list in the frontend if the following conditions are met:
- 'Activate filters' is set to true within the member list module
- there exists fields within
tl_member
of inputTypecheckbox
and evaluationfeFilterable
set to true
Allows modifying the columns and options for the database query.
// src/EventListener/onGetMembersListener.php
namespace App\EventListener;
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
use Oveleon\ContaoMemberExtensionBundle\Controller\FrontendModule\MemberListController;
#[AsHook('getMembers')]
class onGetMembersListener
{
public function __invoke(array &$columns, array &$options, MemberListController &$context): void
{
// Do something...
}
}
Allows modifying the member detail page
// src/EventListener/onParseMemberReaderListener.php
namespace App\EventListener;
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
use Contao\MemberModel;
use Contao\Model;
use Contao\ModuleModel;
use Contao\Template;
use Oveleon\ContaoMemberExtensionBundle\Controller\FrontendModule\MemberReaderController;
#[AsHook('parseMemberReader')]
class onParseMemberReaderListener
{
public function __invoke(MemberModel|Model &$member, Template &$template, ModuleModel &$model, MemberReaderController &$context): void
{
// Do something...
}
}
Allows modifying the member details
// src/EventListener/onParseMemberTemplateListener.php
namespace App\EventListener;
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
use Contao\FrontendTemplate;
use Contao\MemberModel;
use Contao\Model;
use Contao\ModuleModel;
use Oveleon\ContaoMemberExtensionBundle\Controller\FrontendModule\MemberExtensionController;
#[AsHook('parseMemberTemplate')]
class onParseMemberTemplateListener
{
public function __invoke(MemberModel|Model &$member, array &$fields, FrontendTemplate &$template, ModuleModel &$model, MemberExtensionController &$context): void
{
// Do something...
}
}
We only provide support for bugs, and feature requests; please only post issues about these two topics.
If you need help implementing Contao Member Extension Bundle or you are just starting out with Contao/CSS or HTML, please contact us on our website, visit the Contao Community or the Contao Slack, you will be able to find more help there.
This will help us to keep the issues related to this plugin and solve them faster.
If you think this plugin is useful, please consider sponsoring us to help contribute to our time invested and to further development of this and other open source projects.
Your contributions, whether through coding
, testing
, providing feedback
, or even
a donation, help ensure that we can continue offering free open source software.
Join us in making a difference, and thank you for your support! - Oveleon.