Skip to content

Commit f869fd8

Browse files
dabrtmnocon
andauthored
Apply suggestions from code review
Co-authored-by: Marek Nocoń <[email protected]>
1 parent 0ccda82 commit f869fd8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/content_management/images/add_image_asset_from_dam.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ To extend the DAM support built into [[= product_name =]], you must create a cus
9696

9797
This class handles searching through Wikimedia Commons for images and fetching image assets.
9898

99-
In `src\Connector\Dam\Handler` folder, create the `WikimediaCommonsHandler.php` file that resembles the following example,
99+
In `src/Connector/Dam/Handler` folder, create the `WikimediaCommonsHandler.php` file that resembles the following example,
100100
which implements [`search()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Connector-Dam-Handler-Handler.html#method_search) to query the server
101101
and [`fetchAsset()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Connector-Dam-Handler-Handler.html#method_fetchAsset) to return asset objects:
102102

103103
```php
104104
[[= include_file('code_samples/back_office/images/src/Connector/Dam/Handler/WikimediaCommonsHandler.php') =]]
105105
```
106106

107-
Then, in `config\services.yaml`, register the handler as a service:
107+
Then, in `config/services.yaml`, register the handler as a service:
108108

109109
```yaml
110110
[[= include_file('code_samples/back_office/images/config/services.yaml', 9, 12) =]]
@@ -116,7 +116,7 @@ The `source` parameter passed in the tag is an identifier of this new DAM connec
116116

117117
The transformation factory maps [[= product_name =]]'s image variations to corresponding variations from Wikimedia Commons.
118118

119-
In `src\Connector\Dam\Transformation` folder, create the `WikimediaCommonsTransformationFactory.php` file that resembles the following example,
119+
In `src/Connector/Dam/Transformation` folder, create the `WikimediaCommonsTransformationFactory.php` file that resembles the following example,
120120
which implements the [`TransformationFactory` interface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Connector-Dam-Variation-TransformationFactory.html):
121121

122122
```php
@@ -134,15 +134,15 @@ Then register the transformation factory as a service:
134134
The variation generator applies map parameters coming from the transformation factory to build a fetch request to the DAM.
135135
The solution uses the built-in `URLBasedVariationGenerator` class, which adds all the map elements as query parameters to the request.
136136

137-
For example, the handler generates the following URL with [`new AssetUri()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Connector-Dam-AssetUri.html#method___construct):
137+
For example, for an asset with the ID `Ibexa_Logo.svg`, the handler generates the Asset with [`AssetUri's URL`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Connector-Dam-AssetUri.htm#method_getPatht) equal to:
138138

139139
`https://commons.wikimedia.org/w/index.php?title=Special:Redirect/file/Ibexa_Logo.svg`
140140

141141
When the user requests a specific variation of the image, for example, "large", the variation generator modifies the URL and returns it in the following form:
142142

143143
`https://commons.wikimedia.org/w/index.php?title=Special:Redirect/file/Ibexa_Logo.svg&width=300`
144144

145-
For this to happen, register the variations generator as a service:
145+
For this to happen, register the variations generator as a service available for the custom `commons` connector:
146146

147147
```yaml
148148
[[= include_file('code_samples/back_office/images/config/services.yaml', 17, 21) =]]
@@ -184,7 +184,7 @@ Replace `<scope>` with an [appropriate value](siteaccess_aware_configuration.md)
184184
### Provide back office translation
185185

186186
When the image asset field is displayed in the back office, a table of metadata follows.
187-
This example uses new fields, so you need to provide translations for their labels.
187+
This example uses new fields, so you need to provide translations for their labels, for example, in `translations/ibexa_fieldtypes_preview.en.yaml`:
188188

189189
```yaml
190190
[[= include_file('code_samples/back_office/images/translations/ibexa_fieldtypes_preview.en.yaml') =]]

0 commit comments

Comments
 (0)