Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.
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
Thank you, yes that did the trick.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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.
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
Thank you, yes that did the trick.
is working on a reply...