Copied to clipboard

Flag this post as spam?

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


  • SinkyPars 132 posts 175 karma points
    May 25, 2011 @ 17:28
    SinkyPars
    1

    DocumentType Multi Site Dropdown

    Hi guys,

    I have drawn a blank here (I think because its been so long since I had to do this).

    I have an umbraco installation which contains three sites. I want to create a datatype which will be a dropdown of type client.

    Type client should be unique to each site.

    How can I create a drop down which will take the current node (in the backend) find its home page and then return the children which are of type client?

    Thanks

     

    S

  • Hendy Racher 861 posts 3844 karma points MVP 2x admin c-trib
    May 25, 2011 @ 17:40
    Hendy Racher
    4

    Hi SinkyPars,

    You could use the uComponents XPath DropDownList datatype, and configure it with an XPath expression like:

    $currentPage/ancestor-or-self::HomePageDocType/descendent::TypeClientDocType

    or (if using the lastest build)

    $ancestorOrSelf/ancestor-or-self::HomePageDocType/descendent::TypeClientDocType

    HTH,

    Hendy

  • Tom Fulton 2030 posts 4996 karma points c-trib
    May 25, 2011 @ 17:41
    Tom Fulton
    2

    Hi,

    You can use XPath DropDownList from uComponents for this.  It supports setting the dropdown options via an XPath Statement, so you can do something like: $parentPage/ancestor-or-self::SiteHomepage//Client to select only "Client" documents under the current "SiteHomepage" tree.

    Hope this helps,
    Tom

  • Tom Fulton 2030 posts 4996 karma points c-trib
    May 25, 2011 @ 17:42
    Tom Fulton
    0

    You're getting quicker, Hendy :)

  • SinkyPars 132 posts 175 karma points
    May 25, 2011 @ 17:53
    SinkyPars
    0

    Great guys thanks!"

    S

  • SinkyPars 132 posts 175 karma points
    May 25, 2011 @ 17:59
    SinkyPars
    0

    Ah, doesnt seem to work so I tried this:

    $currentPage/ancestor-or-self::*[@isDoc and name() = 'Homepage']/descendent::*[@isDoc and name() = 'Client']

    But I still get:

    Syntax error in XPath expression

    :S

    Any ideas why?

    Thanks

    S

  • Hendy Racher 861 posts 3844 karma points MVP 2x admin c-trib
    May 25, 2011 @ 18:23
    Hendy Racher
    0

    Hi SinkyPars,

    Is the current node published ?

    Does it work if you test on the doctype alias rather than the node name ?

    (the datatype will definitely do what you want)

    Cheers,

    Hendy

     

  • Tom Fulton 2030 posts 4996 karma points c-trib
    May 25, 2011 @ 18:34
    Tom Fulton
    1

    I think descendant is spelled wrong?  (e instead of i) ?

    -Tom

  • Hendy Racher 861 posts 3844 karma points MVP 2x admin c-trib
    May 25, 2011 @ 18:41
    Hendy Racher
    0

    Oh yeah, oops ! well spotted :)

    Could avoid having to remember how to spell 'descendant' using Toms example above.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies