Add the following line at the top of the template: @using IntelligenceBank.Umbraco.Connector.Core.Models;
IntelligenceBankMediaItem - this is an HTML extension that allows you to automatically generate the necessary tags depending on the type of media (images, video, file, audio)
Insert the fields of your page using the code examples below, where the second parameter (example: "ibImagePicker") is the name of your field
Code example:
@Html.IntelligenceBankMediaItem(Model,"ibImagePicker",
new { @class="img-fluid"})
Code example:
@Html.IntelligenceBankMediaItem(Model,"ibImagePickerCustom",
new { @class="img-fluid", alt="Custom text"})
Code example:
@Html.IntelligenceBankMediaItem(Model,"ibAudioPicker")
Code example:
@Html.IntelligenceBankMediaItem(Model,"ibApplicationPicker")
Code example:
@Html.IntelligenceBankMediaItem(Model,"ibVideoPicker", new { width="800", height="370"})
Nothing new is needed to render the RTE. Standard Umbraco approach. Code example:
@Model.Value("rteOldStyle")
Lorem ipsum was conceived as filler text, formatted in a certain way to enable the presentation of graphic elements in documents, without the need for formal copy.
Nothing new is needed to render the RTE.Standard Umbraco approach. Code example:
@Model.Value("rteNewStyle")
Nothing new is needed to render the Grid. Standard Umbraco approach. Code example:
@Html.GetGridHtml(Model, "gridComponent")
@Html.IntelligenceBankMediaItem(Model,"ibImagePicker", htmlAttributes: new { width="500"}, transform:"preset=VOEb")
Here's a summary of the available parameters that can be used in the media query parameter:
To utilize these parameters in the IntelligenceBankMediaItem, you can pass them as a query string in the 'transform' parameter. For example, in the provided code snippet, transform: "size=500x500" sets the size of the displayed image to 500 pixels width and 500 pixels height.
@Html.IntelligenceBankMediaItem(Model,"ibImagePicker", transform:"size=500x500")
You can combine multiple parameters in the transform parameter using the & character as a separator.
For example, "size=400x400&crop=200x200&cropgravity=East" would resize the image to 400x400 and crop it.
@Html.IntelligenceBankMediaItem(Model,"ibImagePicker", transform:"size=400x400&crop=200x200&cropgravity=East")
If you want to use transformation for RTE or Grid, call the Transform method. Make sure that
@using IntelligenceBank.Umbraco.Connector.Core.Models; is included.
But keep in mind that the transformation will be applied to all objects inside. That means if you insert 2 images
into the Grid from IntelligenceBank and apply the transformation, it will be applied to both of the IntelligenceBank images.
Example for RTE:
@Model.Value("rteNewStyle").Transform("size=300x200")
will render:
Lorem ipsum was conceived as filler text, formatted in a certain way to enable the presentation of graphic elements in documents, without the need for formal copy.
@Html.GetGridHtml(Model, "gridComponent").Transform("size=200x200")
For more detail on the available parameters, please refer to the following article:
https://help.intelligencebank.com/hc/en-us/articles/360013682011-Manual-Transformations-of-Images-via-Public-Share-URLsA direct call to the field (standard Umbraco approach) will always return a string to the CDN
You can also call any property of the IntelligenceBankMediaItem element.
Available properties:
Methods:
@Model.Value("ibImagePicker")
will return:
https://cdn.intelligencebank.com/us/share/4zK1AG/ble6/z9jE/original/Weyne+Yew+Flinders+Street https://cdn.intelligencebank.com/us/share/4zK1AG/ble6/z9jE/original/Weyne+Yew+Flinders+Street
will return:
<img src="https://cdn.intelligencebank.com/us/share/4zK1AG/ble6/z9jE/original/Weyne+Yew+Flinders+Street" />@Html.Raw(Model.Value("ibImagePicker").FileName">
will return:
weyne-yew-iFdPrhOPI_E-unsplash.jpgUse Transform() method to apply the transformation
@Html.Raw(Model.Value("ibImagePicker").Transform("size=400x400"))">
will return:
https://cdn.intelligencebank.com/us/share/4zK1AG/ble6/z9jE/size=400x400/Weyne+Yew+Flinders+Street