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
How do i get the name of a folder located in the media section from it s ID? Example: i have a folder called "instruments" with an id of "1262" How do i get umbraco to render "instruments" instead of "1262". Any help is appreciated. Thanks
Folder is a media type just like Image or File, so you should be able to use Getmedia to get the xml for the folder.
thats what i thought, but [code] [/code] renders all the files insdide the folder, and not the folder name...
Hi, new Node(1262).Text or umbraco.library:GetXmlNodeById(id)/@nodeName (Not sure which option you've choosen, xslt or user control?) Regards, /Dirk
[quote=Claushingebjerg]thats what i thought, but [code] [/code] renders all the files insdide the folder, and not the folder name...[/quote] Yes that is by design. You have to look for the nodeName attribute: Sorry for not being clear enough.
Thanks again, but [code] [/code] Doesn't return anything. But if i swap the id with an id of a content node (1047) it returns the nodename just fine?!?! Just to clear things up, im using xslt. NOT usercontrol
Thanks Daniel, that did the job
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
getting a media folder name from id
How do i get the name of a folder located in the media section from it s ID?
Example:
i have a folder called "instruments" with an id of "1262"
How do i get umbraco to render "instruments" instead of "1262".
Any help is appreciated. Thanks
Folder is a media type just like Image or File, so you should be able to use Getmedia to get the xml for the folder.
thats what i thought, but
[code]
[/code]
renders all the files insdide the folder, and not the folder name...
Hi,
new Node(1262).Text or umbraco.library:GetXmlNodeById(id)/@nodeName
(Not sure which option you've choosen, xslt or user control?)
Regards,
/Dirk
[quote=Claushingebjerg]thats what i thought, but
[code]
[/code]
renders all the files insdide the folder, and not the folder name...[/quote]
Yes that is by design. You have to look for the nodeName attribute:
Sorry for not being clear enough.
Thanks again, but
[code]
[/code]
Doesn't return anything.
But if i swap the id with an id of a content node (1047) it returns the nodename just fine?!?!
Just to clear things up, im using xslt. NOT usercontrol
Thanks Daniel, that did the job
is working on a reply...