Sab Ra
Sab Ra

Reputation: 51

Can we get the count of created nodes of a specific document type in Umbraco razor view

If i have a node with documenttype alias as "entry", which is created as a child node to many different root and child pages, is there a way to get the total count on created "entry" type nodes and display in razor view in Umbraco?

Upvotes: 2

Views: 373

Answers (1)

Davor Zlotrg
Davor Zlotrg

Reputation: 6050

Yes, of course, for v7 use:

Model.Content.Site().Descendants("entry").Count()

for v8

@Model.Root().DescendantsOfType("entry").Count()

Upvotes: 3

Related Questions