Problem getting root property values from pages deeper in the content tree
Version: Umbraco 7.2.4
In my content tree i have a main site node with a bunch of separate subsite nodes. The main site and subsite nodes have difference doctypes so i can restrict subsite allowed doctypes (sadly required).
main site
subsite1
subsite2
etc..
On both doctypes i have Site Setting properties which i need to access.
I thought the following code would work but it doesn't when i am deeper in the content tree. There is no error but a bool will return false even though it is false.
I can't use AncestorOrSelf("FrontPage") because i also have the subsite "SubsiteFrontPage" doctype so i really need to access the root without specifying doctype.
Problem getting root property values from pages deeper in the content tree
Version: Umbraco 7.2.4
In my content tree i have a main site node with a bunch of separate subsite nodes. The main site and subsite nodes have difference doctypes so i can restrict subsite allowed doctypes (sadly required).
On both doctypes i have Site Setting properties which i need to access.
I thought the following code would work but it doesn't when i am deeper in the content tree. There is no error but a bool will return false even though it is false.
I can't use AncestorOrSelf("FrontPage") because i also have the subsite "SubsiteFrontPage" doctype so i really need to access the root without specifying doctype.
use
bool showSearch = Model.Content.AncestorOrSelf(1).GetPropertyValue
this gets the Root Node of the actual Node
or use
IEnumerable
to get all Nodes at Root Level.
Cheers, Andreas
Cheers mate. That did the trick. Lots of frustration prevented :)
is working on a reply...