Unrelated to the above but worth knowing if you ever receive an error like this:
The model item passed into the dictionary is of type 'Castle.Proxies.HomepageProxy', but this dictionary requires a model item of type 'Umbraco.Web.Models.RenderModel'.
It looks like this is related to uSiteBuilder's default behaviour of setting an Umbraco default MVC controller. This requires all template aliases to match the doctype alias. I'm not sure why this is the default behaviour, but if you want to disable it, add this your appSettings:
FYI, there's no current way of accessing properties from mixins, but I'm hoping that once 7.2 comes out we can change the code from using attributes (evil) to using class inheritence (good) and having the default behaviour of uSiteBuilder create doctypes with compositions rather than inherited doctypes.
That way we'll have easy to use doctypes in Umbraco with compositions, and access to the properties via intellisense in VS.
Strongly typed views and mixins
Hi,
Using 7.1.6, uSiteBuilder 2.0.1.
I have 2 views:
2 doctypes:
Meta contains thing like page title, meta description etc.
Homepage is being told to pull in navigation properties using the mixins attribute:
The import works fine and I can create a new homepage node and access the meta properties.
I have set up my templates like so:
I can access the homepage doctype properties just fine, but I have no idea how to access the mixin properties. Using the following:
@Model.Content.Properties["MetaTitle"].Value
Gives me the following error:
'Castle.Proxies.HomepageProxy' does not contain a definition for 'Content'
Changing my master layout to inherit from Umbraco.Web.Mvc.UmbracoViewPage<dynamic> yields the same error.
Is there no way to access a properties collection within a strongly typed view?
Greg
Unrelated to the above but worth knowing if you ever receive an error like this:
The model item passed into the dictionary is of type 'Castle.Proxies.HomepageProxy', but this dictionary requires a model item of type 'Umbraco.Web.Models.RenderModel'.
It looks like this is related to uSiteBuilder's default behaviour of setting an Umbraco default MVC controller. This requires all template aliases to match the doctype alias. I'm not sure why this is the default behaviour, but if you want to disable it, add this your appSettings:
FYI, there's no current way of accessing properties from mixins, but I'm hoping that once 7.2 comes out we can change the code from using attributes (evil) to using class inheritence (good) and having the default behaviour of uSiteBuilder create doctypes with compositions rather than inherited doctypes.
That way we'll have easy to use doctypes in Umbraco with compositions, and access to the properties via intellisense in VS.
is working on a reply...