When you say "UmbracoHelper" this means I can do something like "Umbraco.AssignedContentItem.AncestorOrSelf("home")" inside the SurfaceController and I will be okay without any dynamic stuff?
As for using xPath or Examine, can you refer me to any tutorial or article on using both for data query? I assume they provide the same functionality as using the Descendants() and other methods?
Best practices querying data inside SurfaceController
Hello,
I am reading with Umbraco v8 dynamics will be removed.
With the latest version of Umbraco v7, even using Node.Children.Where() is obsolete.
My question is:
Thanks Bilal
Hi Bilal
The replacement is "Umbraco.AssignedContentItem", try to use it.
Just use "UmbracoHelper" inside SurfaceController for queries or even better xPath or Examine queries if it's really complex stuff.
Read more about common pitfalls - https://our.umbraco.com/documentation/reference/Common-Pitfalls/#too-much-linq---xpath-is-still-your-friend
Thanks,
Alex
Thanks Alex!
When you say "UmbracoHelper" this means I can do something like "Umbraco.AssignedContentItem.AncestorOrSelf("home")" inside the SurfaceController and I will be okay without any dynamic stuff?
As for using xPath or Examine, can you refer me to any tutorial or article on using both for data query? I assume they provide the same functionality as using the Descendants() and other methods?
Regards Bilal
is working on a reply...