You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my Habitat-like demo project, I have not been able to get multiple configurations to work out. Maybe I'm doing something wrong, but here's what's happening...
First, I have a feature project for Metadata that includes a base template with fields like Page Title, Meta Description, etc. In Habitat-style, this project contains all of the Unicorn and Sitecore configuration, controller, model, view, etc for this feature so I'd like to have the Synthesis code (interfaces and models) generate into this project.
I also have a "project layer" project that includes all of my page templates (the ones content authors will actually create instances of in Sitecore). These inherit from the Metadata template.
If I only configure Synthesis for the Metadata project, then my page which uses a page template from the latter project cannot be cast to the IMetadata interface ( Sitecore.Context.Item.As() ). Whenever I set up a Synthesis configuration for the other project, I get models that inherit from IMetadata but code inside of the Metadata project still cannot cast to IMetadata. I presume because that project doesn't reference the project containing the concrete implementation? (the dependencies have to flow the other direction - the page templates project can depend on the metadata project, but not the other direction).
I did try changing the order that the configurations are defined and the assemblies get added to the ConfigRegistrar, but that generated code that wouldn't compile (the page templates try to inherit from IMetadata in some weird looking namespace).
I have all of this in a smallish demo project that I can share if you want to look at it or if you want to jump on a screenshare session sometime... You can hit me up on Sitecore Slack as @kevin-williams.
The text was updated successfully, but these errors were encountered:
Sorry just saw this - I guess gmail was filing it under spam. I'll give
this another try since it's been like a month or more since I tried it.
Thanks!
In my Habitat-like demo project, I have not been able to get multiple configurations to work out. Maybe I'm doing something wrong, but here's what's happening...
First, I have a feature project for Metadata that includes a base template with fields like Page Title, Meta Description, etc. In Habitat-style, this project contains all of the Unicorn and Sitecore configuration, controller, model, view, etc for this feature so I'd like to have the Synthesis code (interfaces and models) generate into this project.
I also have a "project layer" project that includes all of my page templates (the ones content authors will actually create instances of in Sitecore). These inherit from the Metadata template.
If I only configure Synthesis for the Metadata project, then my page which uses a page template from the latter project cannot be cast to the IMetadata interface ( Sitecore.Context.Item.As() ). Whenever I set up a Synthesis configuration for the other project, I get models that inherit from IMetadata but code inside of the Metadata project still cannot cast to IMetadata. I presume because that project doesn't reference the project containing the concrete implementation? (the dependencies have to flow the other direction - the page templates project can depend on the metadata project, but not the other direction).
I did try changing the order that the configurations are defined and the assemblies get added to the ConfigRegistrar, but that generated code that wouldn't compile (the page templates try to inherit from IMetadata in some weird looking namespace).
I have all of this in a smallish demo project that I can share if you want to look at it or if you want to jump on a screenshare session sometime... You can hit me up on Sitecore Slack as @kevin-williams.
The text was updated successfully, but these errors were encountered: