-
Notifications
You must be signed in to change notification settings - Fork 29
Updated Instagram documentation. #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,70 @@ | |
Implements media entity resource provider for Instagram photos and videos. | ||
|
||
Project page: (https://drupal.org/project/media_entity_instagram) | ||
|
||
## Requirements | ||
|
||
1. [Media Entity](https://www.drupal.org/project/media_entity) | ||
|
||
## Installation | ||
|
||
1. Download [Media Entity](https://www.drupal.org/project/media_entity) from Drupal.org. | ||
2. Download [Media Entity Instagram](https://drupal.org/project/media_entity_instagram) from Drupal.org. | ||
3. Install both Media Entity Instagram and Media Entity in the [usual way](https://www.drupal.org/documentation/install/modules-themes/modules-8). | ||
|
||
## Overview | ||
|
||
Instagram field formatter can be used with three different types of fields: | ||
* Text plain fields `string_long`, `string_short` | ||
* Link fields | ||
* Entity reference that references appropriate media bundles | ||
|
||
In the **Usage** section configuration of media bundles and supported field types will be described in detail. | ||
|
||
## Usage | ||
|
||
1. Create a Media bundle | ||
* On `admin/structure` choose **Media bundles** | ||
 | ||
* Click on **+ Add media bundle** | ||
 | ||
* Fill *Label*, *Description* and *Type provider fields* for your media bundle and click **Save media bundle** | ||
 | ||
2. Create an Instagram link field on a Media bundle | ||
* On media bundles overview page choose **Manage fields** on created **Instagram** bundle. | ||
 | ||
* Click on **+ Add field**. For a storage type choose **Link**, fill a *Label* field and click **Save and continue**. | ||
 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One step is missing here. We need to go back to bundle edit page and select this field in the "Field with source information" dropdown. |
||
|
||
2. Create a Media entity | ||
* On `admin/content/media` click on **+ Add media** | ||
 | ||
* Fill *Media name*, *Instagram link* fields similarly as it is displayed below and click **Save**. | ||
 | ||
* The created Instagram media entity is saved. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can mention that validation will fail if incorrect Instagram URL is provided. We could also mention that all this works with embed codes and plaintext fields too. |
||
|
||
 | ||
3. Add an entity (media) reference field on a content type | ||
* On desired content type (i.e. Article), on `admin/structure/types`, click on **Manage fields** | ||
 | ||
* Click on **+ Add field** | ||
 | ||
* From **References** menu choose **Other**, fill the *Label* and click **Save and continue** | ||
 | ||
* Choose **Media** for **Type of item to reference** and click **Save field settings** | ||
 | ||
* Select **Instagram** bundle in **Reference type section** and click **Save settings** | ||
 | ||
4. Add a Text plain (long) field on a content type | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only entity reference field is needed as media entity already stores all info about Instagram that is needed. |
||
* Repeat the first two steps from the section below. Select **Text (plain, long)** from **Add a new field** menu, fill the *Label* and click **Save and continue** | ||
 | ||
5. Add a Link field on a content type | ||
* Go to **Add a new field** page by following the steps from **Step 3**. Select **Link** from **Add a new field** menu, fill the *Label* and click **Save and continue** | ||
 | ||
5. Open Manage display of your content type (in our case *Article*), on `admin/structure/types/manage/article/display` | ||
* Select **Instagram embed** for the three freshly created fields (*Text plain*, *Link*, *Entity media reference*) and then **Save** | ||
 | ||
6. Create a new article with embedded Instagram posts | ||
* For an **Instagram reference** field choose a created entity Instagram entity. **Text** and **Link** fields fill with URLs to Instagram posts. | ||
 | ||
* The Instagram posts are displayed on the saved article page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not true as we will be using field formatter for that.