Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
I am getting
as
{src: '/media/1116/abc.png', crops: [ { "alias": "banner", "width": 900, "height": 400 }, { "alias": "TopBanner", "width": 488, "height": 265 } ]}
I want only src part. I am using macro and this is ok if there is pdf but for image it is giving me this path.
How can i make it work for both image and pdf files.
Thanks
My code is
var file = Parameter.Downloadable_File; var mediaList = file.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); var mediaCollection = Model.MediaById(mediaList); ///Loop @foreach (var item in mediaCollection) { <a href="@item.umbracoFile" class="article-footer__link download-link" target="_blank" download> }
I want to make it work for both image and pdf but in case of image it returns json path which i mentioned above
I am able to do it this way so any type of file can be used
if (item.NodeTypeAlias == "Image") { var imageCrops = JsonConvert.DeserializeObject<ImageCropDataSet>(item.umbracoFile); href = imageCrops.Src; } else { href = item.umbracoFile; }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Multiple media picker in Macro
Hi
I am getting
as
I want only src part. I am using macro and this is ok if there is pdf but for image it is giving me this path.
How can i make it work for both image and pdf files.
Thanks
My code is
I want to make it work for both image and pdf but in case of image it returns json path which i mentioned above
I am able to do it this way so any type of file can be used
Thanks
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.