Visual studio 2015 - doesn't do intellisense properly for Umbraco (pre v7.3) - it's an MVC4 / 5 thing, but that might be why you can't see it?
Inheritance - my views are using
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
if you're inheriting from a model again Intellisense (and the site) might not work.
however, if you want to do things sitewide, i would say have a look at examine, getting nodes of type across a whole site can take some time, using examine is slightly more complex but way faster.
Getting Descendants from Root node
I'm trying to get all descendants of the rootnode (or any node for that matter) from my UmbracoApiController, filtered with Linq.
So basicly what I would want to do is:
This is documented at: https://our.umbraco.org/Documentation/Implementation/Routing/MVC/querying
But somehow, when I select the rootnode form the
UmbracoApiController
, myIPublishedContent
object doesn't have aDescendants()
method.It does have a
Children
property, but obviously this only returns all the direct children, and not all descendants.How else am I able to select all documents, filtered by DocumentTypeAlias, and probably also by other properties (CreatedAt for example)?
Hi
it should have decendants ...
things to check.
Visual studio 2015 - doesn't do intellisense properly for Umbraco (pre v7.3) - it's an MVC4 / 5 thing, but that might be why you can't see it?
Inheritance - my views are using
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
if you're inheriting from a model again Intellisense (and the site) might not work.
however, if you want to do things sitewide, i would say have a look at examine, getting nodes of type across a whole site can take some time, using examine is slightly more complex but way faster.
failing that cache the macro or partial view because that will make it quick too.
I do using Visual Studio 2015, but it's not compiling, so IDE should'nt matter.
I managed to fix this however by using the UmbracoHelper
I ran into the same issue, turns out I was missing a using statement. I had
But also needed to have
Then the descendants option showed up.
is working on a reply...