Copied to clipboard

Flag this post as spam?

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


  • Daniel Horn 319 posts 344 karma points
    Feb 03, 2011 @ 13:30
    Daniel Horn
    0

    Datatype that can pick from media and content

    I need a datatype that can pick nodes from both content and media - it doesnt have to pick multiple nodes just be able to pick both types.

    How would you guys do that?

  • Rasmus Berntsen 215 posts 253 karma points c-trib
    Feb 03, 2011 @ 13:43
    Rasmus Berntsen
    1

    Why not going with two properties on your documenttype? And making one of them more important?

    Select from Content (contentpicker)

    Or select from Media (mediapicker)

     

    Then in your XSLT, do something like this:

    <xsl:choose>

    <xsl:when test="contentpicker !=''">
    ...What to do when contentpicker is not noll
    </xsl:when>

    <xsl:when test="mediapicker !=''">
    ...What to do when mediapicker is not null
    </xsl:when>

    <xsl:otherwise>
    ...What to do (nothing selected)
    </xsl:otherwise>

    <xsl:choose>

     

    That's how I normally solve it... :)

  • Rasmus Berntsen 215 posts 253 karma points c-trib
    Feb 03, 2011 @ 13:45
    Rasmus Berntsen
    0

    Remeber xsl:when stops when it reaches something that's true... So it would never try to execute the mediapicker-code, if something's selected at the contentpicker etc.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Feb 03, 2011 @ 14:19
    Tom Fulton
    2

    uComponents' URL Picker has a choice for "Content" and "Media", you can disable the others.  Think that's the closest you will get at the moment without 2 separate properties

  • Daniel Horn 319 posts 344 karma points
    Feb 03, 2011 @ 14:20
    Daniel Horn
    0

    I thought about it - but i just really like the idea of having only one picker and not having to teach the user about remembering to delete the content node etc.

    But its workable - thanks Berntsen.

     

    Could it be possible to make the content picker a media picker at the same time?

  • Daniel Horn 319 posts 344 karma points
    Feb 03, 2011 @ 15:03
    Daniel Horn
    0

    You posted at the same time Tom, that sounds like a nice solution - will work with it :)

Please Sign in or register to post replies

Write your reply to:

Draft