Hello, I'm using umbraco 7.1.4, trying to follow this example and I am stuck with something.
I want to pick a media folder and then list all images in that folder. In this version of Umbraco the only solution to me seems to have a macro with a Textbox parameter (alias albumFolder).
I could see from the link that you have posted, is the old schema, therefor I think that you should take a look at this like. This list all the image from a folder using the new XML schema.
What if you add a property to you document type, with a alias of albumFolder and the data type should be media picker, and when you have done that add this code to your XSLT file.
After that insert the maco in your template where you want the images to show up. After you have added the macro to the template then go back to Umbraco and on one of the pages of the document type where you added the new property, then choose a folder from the media section.
As you can see the file are usig one of the many library methods called GetMedia. You can find the documentation here:
Since you maybe are new to Umbraco i would provide some good resoruces to start get the basic concepts of Umbraco since it´s just a shall or a framework if you want. If you don´t have installed any starter kits. And therefor you need to bulid up the backoffice so it suit your customer needs.
Here are some good documentation on how to work with Umbraco:
Since you are using the Umbraco 7.1.4, there by default are running MVC, you could consider to do the same but instead of using XSLT, then use Razor. If you are doing that I think that you use create a thread in the razor space on this forum, and then just explain that you wasstarted withXSLT; but I said that you should consider doing in Razor.
No, you have to choose an actual image in the case of a single media picker. So is there no solution to go from a string with the name of the folder, to the ID of the folder? The problem is that I cannot search to find the folder, because the media folders are not listed in $currentPage. Is there some other location where it gives an overview of all mediaFolders?
I think that you can use the numeric in the macro as the parmeter datatype there you can add the id of the folder with the images that you want to display
Media folder name to node id
Hello, I'm using umbraco 7.1.4, trying to follow this example and I am stuck with something.
I want to pick a media folder and then list all images in that folder. In this version of Umbraco the only solution to me seems to have a macro with a Textbox parameter (alias albumFolder).
I then want to use this parameter like this:
But I cannot get this to work. There is no reference in the whole xml doc currentPage to this folder. What am I doing wrong?
Hi Jeremy and welcome to our,
I could see from the link that you have posted, is the old schema, therefor I think that you should take a look at this like. This list all the image from a folder using the new XML schema.
http://our.umbraco.org/wiki/how-tos/xslt-useful-tips-and-snippets/list-images-from-mediafolder-in-umbraco-45-plus
Hope this helps,
/Dennis
The problem is that my ¤tPage does not have the media folders in it. Therefor it cannot retrieve the nodeIDs.
Okay Jeremy,
What if you add a property to you document type, with a alias of albumFolder and the data type should be media picker, and when you have done that add this code to your XSLT file.
After that insert the maco in your template where you want the images to show up. After you have added the macro to the template then go back to Umbraco and on one of the pages of the document type where you added the new property, then choose a folder from the media section.
As you can see the file are usig one of the many library methods called GetMedia. You can find the documentation here:
http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
And for other library methods, aswell.
http://our.umbraco.org/wiki/reference/umbracolibrary
Since you maybe are new to Umbraco i would provide some good resoruces to start get the basic concepts of Umbraco since it´s just a shall or a framework if you want. If you don´t have installed any starter kits. And therefor you need to bulid up the backoffice so it suit your customer needs.
Here are some good documentation on how to work with Umbraco:
http://our.umbraco.org/documentation/Using-Umbraco/Creating-Basic-Site/
Here are some good basic video turtorials on how to work with Umbraco:
http://umbraco.tv/videos/umbraco-v7/implementor/
Since you are using the Umbraco 7.1.4, there by default are running MVC, you could consider to do the same but instead of using XSLT, then use Razor. If you are doing that I think that you use create a thread in the razor space on this forum, and then just explain that you was started with XSLT; but I said that you should consider doing in Razor.
Hope this make sense and helps, in some way.
/Dennis
Yes I see now, using the property of the document type I can select the mediaFolder type. However I want the property to be in the macro, and in the macro the choise of datatype for the properties is much more limited.
Hi Jeremy
Okay in this case, I think that you should choose the single media picker. With this you should also be able to choose a folder.
Hope this helps.
/Dennis
No, you have to choose an actual image in the case of a single media picker. So is there no solution to go from a string with the name of the folder, to the ID of the folder? The problem is that I cannot search to find the folder, because the media folders are not listed in $currentPage. Is there some other location where it gives an overview of all mediaFolders?
Hi Jeremy,
I think that you can use the numeric in the macro as the parmeter datatype there you can add the id of the folder with the images that you want to display
Hope this helps,
/Dennis
It helps but all this does not exactly solve it. Thank you anyway.
Hi
I am having umbraco 6.1.6 version, and insatalled ezsearch package.
Can any one help me out, to exclude folder names, .png, .jpg extensions etc from ezsearch result set.......
i need to retrive content(pages) and some media type (like .doc, .pdf ) only.
Now when I am searching I am getting pics, folder name, which I dont want to show it in ezsearch result.
Thanks in advance.
is working on a reply...