if(CurrentPage.HasValue("pickBannerFolderFromMedia"))
{
var sliders = Umbraco.Media(CurrentPage.pickBannerFolderFromMedia);
foreach(var slider in sliders.Children)
<!-- Enables value converters for all built in property editors so that they return strongly typed object, recommended for use with Models Builder -->
<EnablePropertyValueConverters>true</EnablePropertyValueConverters>
The property vlue converter is set to true. Do I need to do something else to activate the property value converter please ?
Media picker 7.6.3
Hello,
I am using media picker in umbraco 7.6.3.
And I am using the code
But the above is not working.
Thanks for helping.
kusum
Hi Kusum,
You need to use something like this
where "sliders" is the property name assigned to the media picker. Then your foreach loop should work by saying
Does that help?
Emma
Hello Emma,
No its not working.
Actually when I do :
I get the id of the media folder. But then I cannot do a foreach to get the images in the folder.
Hi Kusum and Emma
It looks like you don't have property value converter on your project. Try this code:
Thanks,
Alex
Hello Alex,
Thanks for your reply . It is working.
The property vlue converter is set to true. Do I need to do something else to activate the property value converter please ?
This property is enough for enabling it.
Thanks,
Alex
Ok thanks,
And if I want to get the value of a field in Media
Previouslyt I used to do @slider.textboxOne and it worked. But now it's not working.
Is there any documentation to which I can refer ?
Regards,
kusum
It should work:
Read more here:
https://our.umbraco.org/documentation/reference/querying/ipublishedcontent/
https://our.umbraco.org/documentation/reference/querying/ipublishedcontent/Properties
Sorry to bother you again Alex :
I have tried the below on image cropping
But not working. I am sorry I am completely lost with this 7.6 :(
It works for me:
Hello Alex,
Please find below the error I am getting :
Hello Kusum
"mediaFolder" var is null in your case, can you debug and fix it?
Thanks,
Alex
is working on a reply...