Skip to content

Instantly share code, notes, and snippets.

@mattbrailsford
Created February 5, 2013 21:26
Show Gist options
  • Save mattbrailsford/4717814 to your computer and use it in GitHub Desktop.
Save mattbrailsford/4717814 to your computer and use it in GitHub Desktop.
var testimonials = Model.Content.AncestorOrSelf(1)
.Sibling("Repository")
.Descendants("Testimonial");
@sniffdk
Copy link

sniffdk commented Feb 5, 2013

You could perhaps use Examine to get testimonials:

var testimonials = Model.Content.AncestorOrSelf(1)
    .Sibling("Repository")
    .SearchDescendants("Testimonial", false);

@coolmikkel
Copy link

I use the following way to get to siblings of Homepage.
something like this:

dynamic root = Model.NodeById(-1);
dynamic testamonial = root.Descendants("Testimonial");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment