Copied to clipboard

Flag this post as spam?

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


  • Bas Schouten 135 posts 233 karma points
    Oct 23, 2009 @ 23:52
    Bas Schouten
    0

    Ultimate picker and xslt

    I've been searching the forum for examples of using the values from a ultimate picker and display it with xslt.

    I want use it for a news module wth categories for example. 

    Maybe there is a way to acces the Umbraco XML file's. That will make it easyer to start writing the xpath and the rest of the code?

    Somebody got advise? 

  • SaphuA 124 posts 87 karma points
    Oct 24, 2009 @ 00:14
  • Max Edwards 26 posts 50 karma points
    Oct 24, 2009 @ 13:59
    Max Edwards
    0

    you can access the source xml file to help with your XSLT at \data\umbraco.config

  • Kim Andersen 1447 posts 2196 karma points MVP
    Oct 25, 2009 @ 21:53
    Kim Andersen
    2

    If you have an UltimatePicker with an alias of 'myPicker', you could write out the content of the field, in a textarea, for a better overview like this:

    <xsl:variable name="myVar" select="$currentPage/data[@alias='myPicker']" />
    <textarea>
    <xsl:copy-of select="$myVar" />
    </textarea>

    I often use a textarea so that I know excatly what kind of XML I can use. When you have your XML in the textarea, you could copy/paste it into a editor that gives you a better view of the code.

    Some times it also helpes to write out the $currentPage in a textarea in the same way like this:

    <textarea>
    <xsl:copy-of select="$currentPage" />
    </textarea>

    Then you know excaly wich fields you can use, and gives a good overview over what kind of childnodes etc. the current page has.

     

    Hope this helps a bit...

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Oct 25, 2009 @ 22:47
    Jan Skovgaard
    2

    @Kim: great tip! :)

    @Bas: When you use the ultimate picker, your values are in a chunk/array, which is seperated by an array.

    To access them you can assign the value of your ultimate picker property to a variable and split the values, using the umbraco.library:Split function like this

    <xsl:variable name="ultimatePickerContent" select="umbraco.library:Split($currentPage/data [@alias = 'yourproperty'],',')" />

    This returns a XML snippet, which has one or more <value> elements. The values that are returned are the node id's of those nodes you have selected. You can fetch the content like this:

    <xsl:for-each select="$ultimatePickerContent//value">
    <div>
        <p><xsl:value-of select="umbraco.library:GetXmlNodeById(.)/data [@alias='boxHeader']" /></p>
    </div>
    </xsl:for-each>

    Please note that the dot is a reference to the so called "context node".

    Hope this makes sense.

    /Jan

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Oct 26, 2009 @ 00:43
    Lee Kelleher
    1

    Hi Bas, I understand your frustration... I wrote up a blog post about this a few weeks ago!

    http://blog.leekelleher.com/2009/09/08/umbraco-ultimate-picker-xslt-example/

    Cheers, Lee.

  • Anders Tillebeck 15 posts 36 karma points
    Nov 20, 2009 @ 10:29
    Anders Tillebeck
    0

    Hello. I just tried to create a lot of different properties for a new document type, also the Property of the type "Ultimate Picker". But the "ultimate Picker" gives no functionality in the backend when trying to edit a page of that document type.

    I guess the Ultimate Picker should work out-of-the-box somehow. Shouldn't it? I just get listed the name plus the description I gave it:

    Ultimate picker
    default Ultimate Picker description

    But to the right of the picker there is nothing there can be done or choosen. Any clues on why?

     

    I also created a lot of other properties. Most worked as espected. But along with the "Ultimate Picker" the "Folder Browser" did not work either. Same result with an empty area to the right in the backend where I expected to be able to choose a fodler or two.

    It is a new installation with Runway. Umbraco is version: umbraco v 4.0.2.1 (Assembly version: 1.0.3441.17657)

    BR. Anders

  • Kim Andersen 1447 posts 2196 karma points MVP
    Nov 20, 2009 @ 11:16
    Kim Andersen
    1

    Hi Anders

     

    The Ultimate Picker doesn't just work out of the box. You have to configure it to show the options that you need in your page.

    You can do something like this:

    - Go to the developer section in Umbraco and open the "Data types"-folder

    - In here you'll find all of the different datatypes and also the Ultimate Picker

    - Click the Ultimate Picker

    - On the datatype you can configure the picker in some different ways. In example you can type in a Parent nodeId (here you can paste in a Id from one of your nodes in the content tree). This will work as the root node of the property. You also want to define some kind of type. If you want a Dropdown-list you choose DropDownList and so on.

    Try and play around with the different options on the datatype, and you'll find out that the Ultimate Picker actually is useful :)

  • Anders Tillebeck 15 posts 36 karma points
    Nov 24, 2009 @ 12:36
    Anders Tillebeck
    0

    I have just been told from a developer that it does not work out-of-the-box. So just forget my question.

  • Anders Tillebeck 15 posts 36 karma points
    Nov 24, 2009 @ 12:38
    Anders Tillebeck
    0

    Thank, Kim. Didn't see your reply. I would like to pick from a certain folder, so your guide is spot on !!

  • Kim Andersen 1447 posts 2196 karma points MVP
    Nov 26, 2009 @ 17:55
    Kim Andersen
    0

    Great to heat Anders. If this fixes your problem, please mark this thread as answered :)

  • Kim Andersen 1447 posts 2196 karma points MVP
    Nov 26, 2009 @ 17:56
    Kim Andersen
    0

    It should of course say hear and not heat. I miss that edit-button :)

Please Sign in or register to post replies

Write your reply to:

Draft