Multi Site - Multi Language - Multi-Node Tree Picker

Jul 4, 2012 at 2:05 PM
Edited Jul 5, 2012 at 7:06 AM

I have a site built with a structure like this:

  • Website 1 (WEBSITE)
    • DK (HomePage)
      • Page 1 (ContentPage)
      • Page 2 (ContentPage)
      • Page 3 (ContentPage)
      • BOXES (Boxes)
        • Box 1 DK (Box)
        • Box 2 DK (Box)
    • UK
      • Page 1
      • Page 2
      • Page 3
      • BOXES
        • Box 1 UK
        • Box 3 UK
    • FR
      • Page 1
      • Page 2
      • Page 3
      • BOXES
        • Box 1 FR
        • Box 3 FR
  • Website 2

And i'd like to make a Data Type that makes it possible to select "Boxes" from the current site and language only.

For instance, if i'm on page "Website 1 -> UK -> Page 1" i'd only be able to select "Box 1 DK" and "Box 2 DK"

If i'm on "Website 1 -> FR -> Page 1" i'd be able to select "Box 1 FR" and "Box 2 FR"

Is that possible?

I've tried playing around with "Xpath type" and "Xpath Expression", but i can't get it to work.

 

// Bødlen

Coordinator
Jul 4, 2012 at 2:14 PM

Hi Bødlen,

It is possible with MNTP's start node XPath.  Try something like this...

$ancestorOrSelf/*[@isDoc and @level = 2]/*[@isDoc and @nodeName = 'BOXES']

Essentially the XPath is starting from the current page (or parent if unpublished), then navigating up to a Level 2 node (e.g. the country node), then moving back down to a node with the name "BOXES".

It could probably be done much cleaner if I knew the actually DocType alias names.

Good luck!

Cheers, Lee.

Jul 5, 2012 at 7:10 AM

Hi Lee,

I've tried your suggesten but i don't get any boxes in my Content Picker with your sample.

I've set the Xpath type to global, since $ancestorOrSelf doesn't exist in "From current".

Also i updated my list with my Aliases for my different content, maybe you can help me with a different example.

// Bødlen

Coordinator
Jul 5, 2012 at 10:39 AM

Could you provide examples of what you've tried so far?  I haven't got a lot to go on. :-)

Which version of uComponents and Umbraco are you using?

 

Also, it might be worth posting over on the Our Umbraco forum: http://our.umbraco.org/projects/backoffice-extensions/ucomponents/questionssuggestions

As it is open to many more people who might be able to help quicker.

 

Cheers, Lee.