Copied to clipboard

Flag this post as spam?

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


  • CelticHarp 12 posts 52 karma points
    Mar 01, 2013 @ 15:04
    CelticHarp
    0

    AncestorOrSelf at SurfaceController (using CurrentPage)

    I thought that CurrentPage used in controllers had the same methods/properties that Model.Content has in views.

    But it turns out that CurrentPage does not have Ancestor(s)OrSelf, only Parent...

    Am I missing something or this is the way it is?

    I just want to search for a specific ancestor that I want.

    Seems odd. Is there a nice way to find an ancestor based on it's document type alias that I want?

    I am using Umbraco 4.11.

    Thanks.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Mar 03, 2013 @ 12:50
    Jeroen Breuer
    101

    The CurrentPage in the SurfaceController also is an IPublishedContent so it should also have those methods. However it are extension methods so you'll need to add the Umbraco.Web or Umbraco.Core namespace before you can use these methods.

    Jeroen

  • CelticHarp 12 posts 52 karma points
    Mar 04, 2013 @ 08:12
    CelticHarp
    0

    Thank you, yes that did the trick.

Please Sign in or register to post replies

Write your reply to:

Draft