I have nothing to contribute here other than nice work to you both! I wouldn't have known where to start with it, but good to hear there are PR's to get it fixed now :-D
The Models Builder is by default embedded in Umbraco. If you need any complex features, you still need to add the full package. Check the official releases on the Models Builder GitHub repository for more details.
from looking at the pull requests, we're not 100% sure that the updated code was ever merged in and released...
tbh i've ditched the base class idea in a majority of the projects i'm working on as it was to much hassle to get working and i've since gone with other ideas...
however, if you do still need it, you can download the fork that we worked in to solve the problem, build it and then reference the dll:
Appreciate the response. I did exactly this and for my purposes, it at least gets things working. My issue was that a base class was being added to elements, which was preventing the project from building.
how to use a modelsbuilder base class with nested content in v8?
hey out there,
we're building a new site in v8 that uses nested content and the modelsbuilder. nice.
in v7 projects we had a base class that all our generated models build up from e.g.
so we tried to drop this into our shiney new v8 project and everything was running sweet right up until the moment we added a nested content item...
turns out the models generator creates the model as
PublishedElementModel
e.g.so we build our models and not surprisingly get the following error:
is there a way we can tell the modelsbuilder or umbraco to ignore doctypes that are elements?
any suggestions would be grand ;)
cheers,
jake
Has anyone done this? It is super important for v8 and models builder that this works. There doesn't seem to be any documentation anywhere.
Currently still an issue in Models Builder. This really needs to be sorted ASAP.
https://github.com/zpqrtbnk/Zbu.ModelsBuilder/issues/205
just spent some time looking at this with peter and a pull request is in ;)
https://github.com/zpqrtbnk/Zbu.ModelsBuilder/pull/211
this pr solves the base class issue for nested content items, it'd be good to look at the 'ElementModelsBaseClass' idea mentioned in https://github.com/zpqrtbnk/Zbu.ModelsBuilder/issues/205
nice.
boom - part two knocked out too ;)
https://github.com/zpqrtbnk/Zbu.ModelsBuilder/issues/205
is a go. even nicer.
I have nothing to contribute here other than nice work to you both! I wouldn't have known where to start with it, but good to hear there are PR's to get it fixed now :-D
How were you able to get this to work? It doesn't seem to be included in ModelsBuilder 8.1.6?
hi travis,
so, the trick is that the models builder in the most recent versions of umbraco is actually embedded rather than brought in as a nuget package...
https://our.umbraco.com/documentation/reference/templating/modelsbuilder/introduction#installing
from looking at the pull requests, we're not 100% sure that the updated code was ever merged in and released...
tbh i've ditched the base class idea in a majority of the projects i'm working on as it was to much hassle to get working and i've since gone with other ideas...
however, if you do still need it, you can download the fork that we worked in to solve the problem, build it and then reference the dll:
https://github.com/pgregorynz/Zbu.ModelsBuilder
hope that helps ;)
cheers,
jake
Jake,
Appreciate the response. I did exactly this and for my purposes, it at least gets things working. My issue was that a base class was being added to elements, which was preventing the project from building.
Thanks again! Travis
is working on a reply...