1.4.0
This update was funded by @netzarbeiter
Additions
- simultaneous Contao 4.13 and 5.3 compatibility
- Hooks (see below)
- Frontend Filters (see below)
- alias generation (activate in module)
- go back page
Changes
- rewrote hooks
- rewrote modules to frontend controllers
- rewrote avatar upload to
Symfony/UploadedFile
Filter
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
Hooks
getMembers
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...
}
}
parseMemberReader
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...
}
}
parseMemberTemplate
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...
}
}
Full Changelog: 1.3.2...1.4.0