Skip to content

Commit

Permalink
[ADD] Event sLangDocFormFieldRender.
Browse files Browse the repository at this point in the history
  • Loading branch information
Seiger committed Jul 12, 2023
1 parent a7ee856 commit 1e158f7
Show file tree
Hide file tree
Showing 2 changed files with 239 additions and 177 deletions.
19 changes: 18 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,21 @@ Display in the template.
The ```whereTv()``` method allows you to use a filter based on the value of the TV parameter if necessary.
```php
$resource = sLangContent::langAndTvs(evo()->getConfig('lang'), ['tv_image'])->whereTv('tv_image', '!=', '')->get();
```
```

## Admin panel

### Resource fields

You can control the display of resource fields on general tabs through an event ```sLangDocFormFieldRender```.

Usage example from your plugin:
```php
Event::listen('evolution.sLangDocFormFieldRender', function($params) {
if ($params['content']['template'] == 7) {
if ($params['name'] == 'introtext') {
return view('slang.introtext', $params)->render();
}
}
});
```
Loading

0 comments on commit 1e158f7

Please sign in to comment.