Copied to clipboard

Flag this post as spam?

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


  • Richard Jackson 17 posts 127 karma points c-trib
    Sep 01, 2023 @ 13:31
    Richard Jackson
    0

    Singlenode Treepicker OR Content Picker where you can define the content type?

    Hi!

    Is there an editor which only allows a single item to be selected of a specific type?

    The "Content Picker" editor allows you to set a "Start node" but not limit the content types allowed for picking.

    The "Multinode Treepicker" does set the content type allowed ("Allow items of type"), and you can set the maximum number of items to 1 - this is my current working method, but it seems strange to allows return an array of one.

    Thoughts?

    Cheers!

    Rich

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    Sep 05, 2023 @ 09:26
    Nik
    1

    I would use a MNTP as you are currently doing, but you can override the Property Value Converter to change the return type of a property based on it's configuration.

    There is a SuperValueConverters package that can do this for you (although when I last used it there was a small bug that means it breaks some core behaviour for special cases).

    Thanks,

    Nik

  • Richard Jackson 17 posts 127 karma points c-trib
    Sep 05, 2023 @ 09:49
    Richard Jackson
    0

    OH interesting - so, for example, instead of returning the array you can say return the first item of the array? Will explore, ty Nik!

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    Sep 05, 2023 @ 13:23
Please Sign in or register to post replies

Write your reply to:

Draft