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'm having a problem with the get propety of archetype can't get the url of the image cropped here is my code
i tried everything but still the same problem item.GetValue
Hi Youness
Share the code please, can you insert this method like code?
Thanks
I think you should call GetCropUrl on the Url property of the dynamicMediaItem.
GetCropUrl
Url
dynamicMediaItem
If not I'd suggest you debug through and make sure img is the id of the photo, synamicMediaItem is the media item, etc.
yeah but i need first to get the value which is where is the problem
here is my archetype
i just want to get the url of the croped image, i used this :
foreach (ArchetypeFieldsetModel item in featuredItems) { var img = item.GetValue
Ok then is it src instead of url in the dynamic, that is a string and calling GetCropUrl on it should work!
src
url
how can i get the src? because when i use item.GetValue
when you get the photo back that's a Json object, of which you need the src, that is the relative path to the image, on that you can then call GetCropUrl. I don't usually use dyanmic but you should be able to just use .src on it to get that value!
.src
Thanks worked fine!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Can't get imageurl from image cropped with Archetype
Hi. I'm having a problem with the get propety of archetype can't get the url of the image cropped here is my code
i tried everything but still the same problem item.GetValue
Hi Youness
Share the code please, can you insert this method like code?
Thanks
I think you should call
GetCropUrl
on theUrl
property of thedynamicMediaItem
.If not I'd suggest you debug through and make sure img is the id of the photo, synamicMediaItem is the media item, etc.
yeah but i need first to get the value which is where is the problem
here is my archetype
i just want to get the url of the croped image, i used this :
foreach (ArchetypeFieldsetModel item in featuredItems) { var img = item.GetValue
Ok then is it
src
instead ofurl
in the dynamic, that is a string and callingGetCropUrl
on it should work!how can i get the src? because when i use item.GetValue
when you get the photo back that's a Json object, of which you need the src, that is the relative path to the image, on that you can then call
GetCropUrl
. I don't usually use dyanmic but you should be able to just use.src
on it to get that value!Thanks worked fine!
is working on a reply...