Skip to content

Commit 2d9d20c

Browse files
committed
[FEATURE] Added Events documentation
1 parent 6bceeb9 commit 2d9d20c

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

README.md

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ TYPO3 Extension "instagram"
1111
=================================
1212

1313
## What does it do?
14+
1415
TYPO3 Extension to import and display instagram posts/feeds in a TYPO3 Website.
1516

1617
Creates and auto-refreshes long-lived api access tokens, imports
@@ -23,16 +24,22 @@ Frontend-Plugin.
2324
* Automatic refreshing of API access tokens to keep them valid
2425
* Import multiple Instagram users feeds/posts
2526
* Uses official Instagram-API to access a users feed.
26-
* Provides commands to refresh access tokens and to import feeds via cronjob/scheduler
27-
* Downloads the posts (images/videos). No API calls needed when displaying them = no frontend performance impact.
27+
* Provides commands to refresh access tokens and to import feeds via
28+
cronjob/scheduler
29+
* Downloads the posts (images/videos). No API calls needed when displaying
30+
them = no frontend performance impact.
2831
* Display users feeds/posts in any way you like
2932
* Based on Extbase and Fluid
3033

3134
## Installation
32-
The recommended way to install the extension is by using [Composer](https://getcomposer.org/). In your Composer based TYPO3 project root, just do:
35+
36+
The recommended way to install the extension is by
37+
using [Composer](https://getcomposer.org/). In your Composer based TYPO3 project
38+
root, just do:
3339
<pre>composer require svenpetersen/instagram</pre>
3440

3541
## Setup
42+
3643
1. Include the provided static TypoScript
3744
2. Create a Facebook "Instagram Basic Display" App: See the
3845
[official Documentation](https://developers.facebook.com/docs/instagram-basic-display-api/getting-started)
@@ -50,13 +57,15 @@ __Recommended__:
5057
* Add a cronjob/scheduler task to import the posts on a regular basis
5158

5259
## Compatibility
60+
5361
| Version | TYPO3 | PHP | Support/Development |
5462
|---------|-------------|------------|--------------------------------------|
5563
| 1.x | 10.4 - 11.5 | 7.4 - 8.0️ | Features, Bugfixes, Security Updates |
5664

5765
## Funtionalities
5866

5967
### Automatic import of posts
68+
6069
This extension comes with a command to import (new) posts of a given instagram
6170
user.
6271
It is recommended to set this command up to run regularly - e.g. once a day.
@@ -79,8 +88,8 @@ __Options:__
7988
| --since | Date string to fetch posts since (Format: "MM/DD/YYYY H:i:s"). |
8089
| --until | Date string to fetch posts until (Format: "MM/DD/YYYY H:i:s"). |
8190

82-
8391
### Automatic Access Token Refreshing
92+
8493
The generated long-lived access token is valid for 60 days.
8594
It can be refreshed when at least 24 hours old.
8695

@@ -92,6 +101,7 @@ Make sure to run this command regularly - e.g. once a day via a
92101
cronjob/scheduler - in order to keep your access token valid.
93102

94103
### Disable/enable Backend module "Token Generator"
104+
95105
To disable the Backend module - e.g. after you generated all needed tokens - add
96106
this
97107
line to the <code>LocalConfiguration.php/AdditionalConfiguration.php</code>:
@@ -100,17 +110,36 @@ line to the <code>LocalConfiguration.php/AdditionalConfiguration.php</code>:
100110
## Extending
101111

102112
### Additional Template Selector
103-
If you need a kind of template selector inside a plugin, you can add your own selections by adding those to:
113+
114+
If you need a kind of template selector inside a plugin, you can add your own
115+
selections by adding those to:
104116
<pre>$GLOBALS['TYPO3_CONF_VARS']['EXT']['instagram']['templateLayouts']['myext'] = ['My Title', 'my value'];</pre>
105117

106118
### Local path to save downloaded files
107-
By default all images/videos in imported posts are saved in <code>/public/fileadmin/instagram</code>
108-
You can change this path via the Extensions settings <code>local_file_storage_path</code> option.
119+
120+
By default all images/videos in imported posts are saved in <code>
121+
/public/fileadmin/instagram</code>
122+
You can change this path via the Extensions settings <code>
123+
local_file_storage_path</code> option.
124+
125+
### Events
126+
127+
This extension comes with a few events for you to listen to and add your own
128+
logic:
129+
130+
| Name | Args. | Description |
131+
|----------------------|---------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
132+
| PreRenderActionEvent | ViewInterface $view <br> string $action | Dispatched before the view is rendered. Can be used to modify the view object. E.g. adding additional vars to the frontend (e.g. pagination) |
133+
| PrePersistPostEvent | Post $post <br> string $action['new' or ‘update'] | Dispatched before a Post is saved. Can be used to modify the Post entity. | Dispatched before the view is rendered. Can be used to modify the view object. E.g. adding additional vars to the frontend (e.g. pagination) |
134+
| PostPersistPostEvent | Post $post | Dispatched after a Post is saved. | Dispatched before the view is rendered. Can be used to modify the view object. E.g. adding additional vars to the frontend (e.g. pagination) |
109135

110136
## Contributing
111-
Please refer to the [contributing](CONTRIBUTING.md) document included in this repository.
137+
138+
Please refer to the [contributing](CONTRIBUTING.md) document included in this
139+
repository.
112140

113141
## Testing
142+
114143
This Extension comes with a testsuite for coding styles and unit/functional
115144
tests.
116145
To run the tests simply use the provided composer script:

0 commit comments

Comments
 (0)