It just works, I've never had any issue with it, even on a multi tenancy site. I couldn't tell you if its better than @CurrentPage.Site().SiteLogo, but it works and it's shorter, so it's a winner for me!
All of these are set from Doc Type properties, via a tab I made called SEO.
Note: The underscore takes you back to the root node. So you can access properties from there on your current page. There are lots of other ways of selecting levels though. Check this cheat sheet out, there isn't one for u7 but its a good reference :-
Accessing properties with @CurrentPage.Site()
Hi,
In one of the starter kits, I've noticed the use of: @CurrentPage.Site().SiteLogo
And in case, a property to be accessed in a recursive way, then: @CurrentPage.siteLogo
Is accessing properties by Tab is a new thing to Umbraco? Which is better to use?
Thanks
Hi Bilal,
I use :-
@CurrentPage._siteLogo
It just works, I've never had any issue with it, even on a multi tenancy site. I couldn't tell you if its better than @CurrentPage.Site().SiteLogo, but it works and it's shorter, so it's a winner for me!
Regards M
Thanks.
So for example I can use a document type to store some configuration data and access them in templates?
Thanks
Indeed you can, for example :-
All of these are set from Doc Type properties, via a tab I made called SEO.
Note: The underscore takes you back to the root node. So you can access properties from there on your current page. There are lots of other ways of selecting levels though. Check this cheat sheet out, there isn't one for u7 but its a good reference :-
https://our.umbraco.org/projects/developer-tools/umbraco-v6-mvc-razor-cheatsheets
Regards M
is working on a reply...