-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BaseModel attribute for PublishedElementModel #205
Comments
Oups. Valid point. |
Pretty vital that this one gets fixed ASAP as it is negating some of the benefits of using Models Builder. The base class functionality reduces the amount of Helper methods and common properties we need to define. We are stalled at present due to this issue. |
Have created pull request to at least ignore the element type from gaining the custom IpublishedContent base class. #211 |
Adds the ability to create a Element base class
Thanks! Definitively going to review. Might take a few more days as I'm partially offline for 1 more week. Stay tuned! |
We have now also added in the attribute for base classing element types. Just needs a Unit test :) |
Took most of the code from the PR + tweaked things & implemented tests. Now we would have:
Patterns can be a plain type name (eg Patterns are ordered by length, longest first, before being applied, and the first one to match wins. So if you have both a Thoughts? |
The pattern stuff is great! We actually have a version close to this on our fork that we were considering submitting that allowed for selective models that had the pattern so you could have multiple base models... Does your version allow for this also? EG a catch all sort of base model, and then selective base models for other types eg "page*" If that is the case this is awesome and is perfect. |
The pattern-less version Here I am assuming that patterns will mostly be "page*" or "*thing" and that we don't want/need to support crazy regex patterns. |
In our instance we have a PageBaseModel and a BlockBaseModel in the same project. Changes can be seen here: The attribute on our class was:
We will update to your version and make sure it does what I think it does and will let you know but it looks about right based on your description 👍 |
|
NICE! Perfect.. We will update our build of models builder and give it a whirl. Overall I think this will make ModelsBuilder super flexible. Our version did, so having it official is awesome! |
was this feature ever released? I'm using Umbraco 8.1.3 and Umbraco.ModelsBuilder 8.1.0 and I can't see it? Thanks |
Not released. A new version of MB is in-progress but, due to the september organization changes, I am only working on it when I have some time available. Back to full open-source mode: it will hopefully be ready, when it's ready ;) |
all good - thanks for letting me know (wanted to make sure it wasn't there and I was just being dense)! |
I'd really like to take advantage of base models on my project. Is there any way I can use it at the moment with Umbraco 8.6, such as a stable fork that contains the fix, or a temporary workaround? |
I am also very interested.... |
I would also love to use this, any updates? |
@zpqrtbnk I checked that and I am using configuration, which replaces your orginal idea, and works perfectly fine. |
In Umbraco 8.0.2, using ModelsBuilder 8.0.4 I'm unable to define a custom BaseModel because now generated Models may inherit from PublishedElementModel and PublishedContentModel. I have a document type which is an Element for NestedContent.
Can't we have another attribute for ElementBaseModel? Like:
[assembly: ModelsBaseClass(typeof(BaseModel))]
[assembly: ElementModelsBaseClass(typeof(ElementBaseModel))]
The text was updated successfully, but these errors were encountered: