Skip to content

Commit 9f6d325

Browse files
committed
Add code samples
1 parent 3ee5017 commit 9f6d325

File tree

1 file changed

+14
-0
lines changed
  • src/Umbraco.Cms.Integrations.DAM.Aprimo

1 file changed

+14
-0
lines changed

src/Umbraco.Cms.Integrations.DAM.Aprimo/readme.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,21 @@ For the selected media asset you can retrieve the crops details using the `Media
8383

8484
It contains the details of the original asset, the list of available crops and a method to retrieve the crop URL based on name and width/height.
8585

86+
For example:
87+
- get URL for crop item with the name _Social_: `@Model.MediaWithCrops.GetCropUrl("Social")`
88+
- get URL for crop item with height _1080_: `@Model.MediaWithCrops.GetCropUrl(null, 1080)`
89+
8690
### Working with fields
8791
The asset's fields are grouped in an object containing their label and a dictionary of values based on the available cultures for that asset.
92+
93+
For example:
94+
- get values for a field with label _Display Title_:
95+
```
96+
var displayTitle = @Model.Fields.FirstOrDefault(p => p.Label == "Display Title");
97+
var values = displayTitle != null
98+
? displayTitle.Values
99+
: default(Dictionary<string, string>());
100+
```
101+
88102
### Version history
89103
- 1.0.0 - Initial release

0 commit comments

Comments
 (0)