Hi
I have a generic controller and want to get a value stored in Umbraco 13 on a page called Product which is under the Home page.
Normally I can use the render controller which gives the current page but on this occasion I can't. How could I get that value in a non render controller class?
Thanks
p
Patrick de Mooij
10/23/2024, 9:19 AM
Hi!
There are a few ways to do this. Non-render controllers don't know anything about the current page. So you should either send over the page id and retrieve the page or search the tree for your product page
t
TigerMan
10/23/2024, 9:37 AM
Do you have a sample code of searching the tree?
I tried UmbracoHelper but that didn't work. All the documentations I've read seem to accept an id/guid but ideally searching the tree would be my preferred approach. 👍
p
Patrick de Mooij
10/23/2024, 9:44 AM
What version are you using? And what sort of controller are you using? ApiController or SurfaceController?