Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Feb 22, 2013 @ 11:14
    Bo Damgaard Mortensen
    0

    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:

    /* [self::LocalNewsFolder/Image]

    and

    /* [descendant-or-self::LocalNewsFolder/Image]

    But then everything is disabled.

    Any input on this is greatly appreciated!

    Thanks in advance.

     

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Feb 22, 2013 @ 11:22
    Chriztian Steinmeier
    0

    Hi Bo,

    You should be able to just use: LocalNewsFolder/Image

    If that doesn't work, try Image[parent::LocalNewsFolder]

    /Chriztian

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Feb 22, 2013 @ 11:37
    Bo Damgaard Mortensen
    0

    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! :-)

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Feb 22, 2013 @ 11:42
    Bo Damgaard Mortensen
    0

    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

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Feb 22, 2013 @ 11:43
    Chriztian Steinmeier
    100

    I believe you :-)

Please Sign in or register to post replies

Write your reply to:

Draft