Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heimrichhannot/contao-participation
A contao backend entity, that allows you to participate to another entity (like news, events) from any url within the front end.
https://github.com/heimrichhannot/contao-participation
Last synced: about 1 month ago
JSON representation
A contao backend entity, that allows you to participate to another entity (like news, events) from any url within the front end.
- Host: GitHub
- URL: https://github.com/heimrichhannot/contao-participation
- Owner: heimrichhannot
- Created: 2015-07-13T09:35:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-29T14:31:25.000Z (over 4 years ago)
- Last Synced: 2024-04-28T19:21:23.727Z (8 months ago)
- Language: PHP
- Size: 32.2 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Participation
A contao backend entity, that allows you to participate to another entity (like news, events) from any url.
## Features
- Participation Archive (global config for participation entitites within)
- Participation (alias to entity connection table)
- Participation Data (member/submission to participation connection table)
## How to extend/invoke with your moduleYou can invoke into participation and participation data. Both should be done within your config.php.
Here an example for news with tl_member as participation data:config.php
```
$GLOBALS['TL_PARTICIPATION']['news'] = array
(
'tl_news' => 'NewsParticipationConfig'
);$GLOBALS['TL_PARTICIPATION_DATA'] = array
(
'member' => array
(
'tl_member' => 'ParticipationDataMyMemberConfig',
)
);
```The Class have to extend from \HeimrichHannot\Participation\ParticipationConfig
NewsParticipationConfig.php
```
class NewsParticipationConfig extends \HeimrichHannot\Participation\ParticipationConfig
{
protected $strSourceField = 'headline';protected $strParentField = 'title';
}
```ParticipationDataMyMemberConfig.php
```
class ParticipationDataMyMemberConfig extends ParticipationDataMemberConfig
{
protected function getSourceOptionValue(\Model $objSource)
{
return $objSource->firstname . ' ' . $objSource->lastname . ' [ID: ' . $objSource->id . ']';
}
}```