Open Closed

Which modules support Module Entity Extensions #2523


User avatar
0
AlderCove created

v5.1.3 / MVC / Separate Identity server

We are trying to use the extension manager to add extra properties to CmsBlogPosts, but CmsKit does not appear in the list of modules:

The documentation indicates the feature is supported for all official modules wherever possible: https://docs.abp.io/en/abp/latest/Module-Entity-Extensions

Does the CmsKit modules support extensions?

Is the list above the exhaustive list of modules that do support the feature?

Thanks


3 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @AlderCove, CMS Kit module does not support module entity extension for now. I've created an issue for it (#11525).

    Is the list above the exhaustive list of modules that do support the feature?

    In addition to this list, there is also ConfigureTenantManagement.

  • User Avatar
    0
    AlderCove created

    OK. Thanks.

    I assume this also applies to adding extra properties to CMS kit entities since I tried adding some to the blog post entity but it did not seem to work either?

    The extra properties feature appears to be tied to the module extension system: https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities

    You can then use the same extra properties system defined in the previous section to manipulate the property over the entity.

    Can you recommend an approach for adding additional properties? Do I need to create a new entity with these properties, create my own service and override the UI? https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities#creating-a-new-entity-with-its-own-database-table-collection

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    No need to create a new entity.

    Using extraproperties without ModuleEntityExtension is possible. You can still add and read new keys via using ExtraProperties. But they'll not create new columns in your databases, they'll be stored as just JSON in a single column:

    You can do it something like that:

        var blogPost = await BlogPostManager.CreateAsync(
                                                        author,
                                                        blog,
                                                        input.Title,
                                                        input.Slug,
                                                        input.ShortDescription,
                                                        input.Content,
                                                        input.CoverImageMediaId);
    
        blogPost.ExtraProperties.Add("MyCustomKey", "My Custom Value");
    
Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09