Umbraco 8 - How to get all page nodes using alias?
Right now I've site structure like this in backoffice:
this is just illustration of node structure.
Home
|-Events
|-Category1
|-Event post 1
|-Event post 2 ...
|-Category2
|- Event post 3
|-Event post 4 ... and so on
All event post have "eventPost" alias
Now I want to show four event posts ordered by created date desc on my home page. How to do that? I tried to built query but don't know how to get all event posts based on alias and Events as parent node.
Essentially 'Children()' will only be looking 'one depth' immediately below your Events node - whereas Descendants, will look at all Children and Children of Children etc
Umbraco 8 - How to get all page nodes using alias?
Right now I've site structure like this in backoffice:
this is just illustration of node structure.
Home |-Events |-Category1 |-Event post 1 |-Event post 2 ... |-Category2 |- Event post 3 |-Event post 4 ... and so on
All event post have "eventPost" alias
Now I want to show four event posts ordered by created date desc on my home page. How to do that? I tried to built query but don't know how to get all event posts based on alias and Events as parent node.
Any help would be great.
Something like this:
Hi Lukaz
Would the following be what you are after:
Essentially 'Children()' will only be looking 'one depth' immediately below your Events node - whereas Descendants, will look at all Children and Children of Children etc
regards
Marc
Hi Marc, thank you for your effort. The given code doesn't resolve my problem, but I've managed to get it work and down below is my solution.
is working on a reply...