Currently trying to get my head around an XPath statement in Multi-Node Tree Picker which should enable the user to select any image that's under/in a folder of a certain media type.
My media section structure looks like this:
- Media - Slideshow images (Type: Folder) - Local news (Type: LocalNewsFolder) - Danmark (Type: LocalNewsFolder) - 1 (Type: Image) - 2 (Type: Image) - Sverige (Type: LocalNewsFolder) - 1 (Type: Image) - 2 (Type: Image) - England (Type: LocalNewsFolder) - 1 (Type: Image) - 2 (Type: Image)
Is there any way to make an XPath statement that tells MNTP that only media items of type Image that's within a LocalNewsFolder can be selected? :-) I don't want the user to be able to select a LocalNewsFolder, but only the images in it.
I realized it was as easy as scratching my back ;-) Could simply set the start node to be the Local news folder and then use the following XPath: /* [self::Image] which works as it should.
However, one problem solved and another is raised. When I log in with my swedish user in Umbraco, I'm also able to select images that's under the Danmark and England folders :-/ Not sure if that's a good idea. Might have to re-think the structure and/or datatypes to use for this.
Oh my.. I think i'm better off for weekend :-D Turns out I was still logged in as the administrator *facepalm* Setting the start node on my swedish user allows me to only see the Sverige folder. Can you believe it? ;-)
MNTP enable XPath
Hi all,
Currently trying to get my head around an XPath statement in Multi-Node Tree Picker which should enable the user to select any image that's under/in a folder of a certain media type.
My media section structure looks like this:
- Media
- Slideshow images (Type: Folder)
- Local news (Type: LocalNewsFolder)
- Danmark (Type: LocalNewsFolder)
- 1 (Type: Image)
- 2 (Type: Image)
- Sverige (Type: LocalNewsFolder)
- 1 (Type: Image)
- 2 (Type: Image)
- England (Type: LocalNewsFolder)
- 1 (Type: Image)
- 2 (Type: Image)
Is there any way to make an XPath statement that tells MNTP that only media items of type Image that's within a LocalNewsFolder can be selected? :-) I don't want the user to be able to select a LocalNewsFolder, but only the images in it.
I have tried with the following:
and
But then everything is disabled.
Any input on this is greatly appreciated!
Thanks in advance.
Hi Bo,
You should be able to just use: LocalNewsFolder/Image
If that doesn't work, try Image[parent::LocalNewsFolder]
/Chriztian
Hi Chriztian,
Thanks a lot for your, as always, fast reply.
I realized it was as easy as scratching my back ;-) Could simply set the start node to be the Local news folder and then use the following XPath: /* [self::Image] which works as it should.
However, one problem solved and another is raised. When I log in with my swedish user in Umbraco, I'm also able to select images that's under the Danmark and England folders :-/ Not sure if that's a good idea. Might have to re-think the structure and/or datatypes to use for this.
Thanks again! :-)
Oh my.. I think i'm better off for weekend :-D Turns out I was still logged in as the administrator *facepalm* Setting the start node on my swedish user allows me to only see the Sverige folder. Can you believe it? ;-)
- Bo
I believe you :-)
is working on a reply...