Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.
public class BaseModel : PublishedContentModel
public BaseModel(IPublishedContent content) : base(content)
public string PageTitle => this.HasValue("title") ? this.GetPropertyValue<string>("title") : Name;
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.
public partial class ImageCarouselItem : PublishedElementModel
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 ;)
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.
just spent some time looking at this with peter and a pull request is in ;)
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
boom - part two knocked out too ;)
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
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted