How to set image css property in libary?
We have various images in an image library. How can I set the css property of a particular image? It seems I can only edit the title and alternate text.
Found about setting custom fields for content types. Added a Css field to the images content type. See docs.sitefinity.com/edit-an-existing-custom-field.
Hi hooman. As i right you understand, you want to add custom field for image.
You can do it in this way:
And after that you need to edit widget designer. Example for feather:
Template should looks like this:
@model Telerik.Sitefinity.Frontend.Media.Mvc.Models.Image.ImageViewModel@if (string.IsNullOrEmpty(Model.LinkedContentUrl)) <img class="@Model.CssClass @Model.Item.Fields.CssClass" src="@Model.SelectedSizeUrl" title="@Model.Title" alt="@Model.AlternativeText" />else <a href="@Model.LinkedContentUrl"> <img class="@Model.CssClass @Model.Item.Fields.CssClass" src="@Model.SelectedSizeUrl" title="@Model.Title" alt="@Model.AlternativeText" /> </a>