Copied to clipboard

Flag this post as spam?

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


  • Niklas Hjelm 104 posts 125 karma points
    Jan 07, 2012 @ 18:09
    Niklas Hjelm
    0

    Recursive Contentpicker Razor

    Hi!

    In my footer I have a picture that I get with this method


    @{ var allNodesWithTags = Model.AncestorOrSelf().DescendantsOrSelf(); }
    @foreach (var node in allNodesWithTags.Where("todaysPicture== true"))

    This dosen't seem very good for performance though, having to check every node and then getting the image. Instead I've thought about using a content picker and selecting the node and then getting the values. Two questions about this.

    1. Is there a way to make it recursive?
    2. Is this better for performance?
    3. Any code examples :)

    Any help is appreciated.

    / Niklas

Please Sign in or register to post replies

Write your reply to:

Draft