Hello Everyone,
I want to display images from specific directory in the server, I have got this code in the partial view but didn't work, any idea please?
Hi Alex,
I really appreciate your help.
I'm going with this way because I have hundreds of folders and i need to get the images from each folder dynamically.
It seems the code you suggest is working, but I have a problem with the image PATH, please advise;
Thank you Alex, I will consider that in the next version.
And for the same code I have tried to add the folder name from PropertyValue but it dosen't work, could you please check the following;
Display images from directory
Hello Everyone, I want to display images from specific directory in the server, I have got this code in the partial view but didn't work, any idea please?
Hi Rayyan
Try this code:
The question is why do you need to show media images .net api? You can do it with Umbraco helper.
Thanks,
Alex
Hi Alex, I really appreciate your help. I'm going with this way because I have hundreds of folders and i need to get the images from each folder dynamically.
It seems the code you suggest is working, but I have a problem with the image PATH, please advise;
E:\web\domain.com\media/1039\homepro.jpg
Thank you very much
Sorry, this code should work:
Working perfectly :) Thanks a million Alex!
You are welcome, Rayyan.
But be aware that it's not a right way to show the image, imagine if somebody will change this image from Umbraco backend?
What do you suggest for my case, having hundreds of folders and I need to display each folder images in specific page?
Thanks
The best case will be to use media picker on the page, and select folder for each page and render with Umbraco helper.
Thank you Alex, I will consider that in the next version. And for the same code I have tried to add the folder name from PropertyValue but it dosen't work, could you please check the following;
Am I doing it in the wrong way?
Hi Rayyan
What is placeID property? How did you store it in Umbraco?
Alex
Hi Alex, Solved, and here's my case.
https://our.umbraco.org/forum/templates-partial-views-and-macros//86984-pick-up-directory-folder-dynamically#comment-275707
Thank you very much indeed :)
You are welcome!
Have a nice evening.
Your help made my day! Have a nice evening you too.
Hi Alex,
Sorry for bothering you, but I have a question...
Is there a way to control the number of the items that the code get from the folder?
Something as below;
Many thanks
Hi Rayyan
Did you solve the issue? Can you share with out community?
Thanks,
Alex
Hi Alex, Here's the question and it's answer...
https://stackoverflow.com/questions/45253870/get-all-the-items-and-limit-the-number-of-the-img-tags-only
Hi Rayyan,
Thanks for sharing, is it working for you?
Alex
Yes, perfectly!
Hi Rayyan
Of course you can do it:
Thanks,
Alex
is working on a reply...