Access global properties in partial view using SiteBuilderBlock instance
I am relatively new to Umbraco and I recently updated to umbraco 10, which is great. For our components we extended the functionality with the uSkinned components. What I want to accomplish is a partial view which must access some global properties configured at Homepage level.
Currently all I have in my partial view is as follows:
What I want, is to access global properties from Homepage level, but I cannot find any property in the instantiated
SiteBuilderBlock
Class.
The properties which are configured in this, so called, CTA group, are configured at the highest level of the project. The values themself are extracted properly.
In the partial view I want to access these values.
Anyone any clue how to gracefully accomplish this?
Currently I found a solution. I can only extract values by there alias on PublishedContent. SiteBuilderBlock has a parented PublishedContent in it's BaseModel which can access the global properties by it's alias:
Model.BaseModel.Parent.Value
Now to be 100% safe, I need to search until parent == null since the properties are defined at top level page.
Access global properties in partial view using SiteBuilderBlock instance
I am relatively new to Umbraco and I recently updated to umbraco 10, which is great. For our components we extended the functionality with the uSkinned components. What I want to accomplish is a partial view which must access some global properties configured at Homepage level.
Currently all I have in my partial view is as follows:
What I want, is to access global properties from Homepage level, but I cannot find any property in the instantiated
Class.
The properties which are configured in this, so called, CTA group, are configured at the highest level of the project. The values themself are extracted properly.
In the partial view I want to access these values.
Anyone any clue how to gracefully accomplish this?
Currently I found a solution. I can only extract values by there alias on PublishedContent. SiteBuilderBlock has a parented PublishedContent in it's BaseModel which can access the global properties by it's alias:
Now to be 100% safe, I need to search until parent == null since the properties are defined at top level page.
is working on a reply...