Copied to clipboard

Flag this post as spam?

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


  • Matthew 16 posts 36 karma points
    Nov 04, 2011 @ 02:22
    Matthew
    0

    URL Picker - Retrieve Data in Template

    Hi,

    I'm using the URL Picker from uComponents and didn't know how to go about getting the data in the template (masterpage). Has anyone had success with this?

    I know I could create an XSLT macro but thought this was a pretty simple case that a solution is bound to be available and simple without dropping into XSLT.

    On the documentation page, it mentions that "if the URL Picker is to be used in a .NET control" it can be parsed using uComponents.Core.DataTypes.UrlPicker.Dto.UrlPickerState.Deserialize -- this may be applicable, but what & how do I pass the page field to it?

    To give a visual, this is the code I have so far - is this on the right path, or totally not how to approach it?

    <umbraco:Item field="link" runat="server" />

    Thanks in advance, Matthew

  • Carl Schéle 8 posts 28 karma points
    Nov 29, 2011 @ 22:39
    Carl Schéle
    0

    Check this thread, it might help you. I'm trying to understand this myself, don't even know how to call the uComponents.Core.DataTypes.UrlPicker.Dto.UrlPickerState.Deserialize method yet. I've referenced the two .dlls that came with the .zip file but still no luck. This is probably totally wrong but have no idea what else to do. Maybe you can shed a light to it?

    PackageActionsContrib.dll

    TheFarm.Umbraco.EmbeddedContent.dll

    http://our.umbraco.org/projects/backoffice-extensions/ucomponents/questionssuggestions/22766-Retrieve-URL-Picker-data-in-Razor

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Nov 30, 2011 @ 09:10
    Dirk De Grave
    0

    Matthew, the url picker datatype stores the document value as an xml string, so either you have to go with xslt, or use c# code to get the values for each of the urls choosen.

    If you don't want the hassle to create xslt macro's, you can also use Lee's package which allows for *inline xslt* in your templates. Haven't used it myself though.

     

    @Carl: you need uComponents.Core assembly to be able to use the Deserialize() method from c# code.

     

    Cheers,

    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft