Hello, I have a new business requirement , So I need to add in extra properties in CMS Module in pages table Is there a way to customize it by using ModuleExtentionConfiguration (like I can customize Identity). In this way I am able to define the extra properties and framework will take care of adding them to the APIs and UI as well.
Here is some information about my application
ABP Framework version: v5.1
UI type: MVC
DB provider: EF Core
7 Answer(s)
-
0
Hello Merna,
As far as I understand, the tables already contain the
ExtraProperties
row in thecms module
tables.AggregateRoot
implementersIHasExtraProperties
so you can use that (more)Please, give us more detail if the answer isn't clear.
Regards.
-
0
Hello , Yes, I know I can use extra properties. But my question. Is there a way to customize it by using ModuleExtentionConfiguration (like I can customize SaaS module entities Tenant and Edition). In this way I'll be able to define the extra properties and framework will take care of adding them to the APIs and UI as well.
But for Cms module I can't find .Configuration or similar extension. There is generic .ConfigureModule extension but it requires the type ModuleExtensionConfiguration for the action. for example :
-
0
Hello,
The module must be developed with the Module Entity Extensions system in mind. All the official modules support this system wherever possible.
moreAlso, you can generate a
YourModuleExtensionConfiguration
by inheriting fromModuleExtensionConfiguration
.There is no direct method for
CmsKitModule
.
It requires the type ModuleExtensionConfiguration for the action.
You're right.Regards
-
0
Hello,
The module must be developed with the Module Entity Extensions system in mind. All the official modules support this system wherever possible.
moreAlso, you can generate a
YourModuleExtensionConfiguration
by inheriting fromModuleExtensionConfiguration
.There is no direct method for
CmsKitModule
.
It requires the type ModuleExtensionConfiguration for the action.
You're right.Regards
Hello,
I have a similar requirement. I wish to extend the CmsKitModule by adding extra properties. Is adding the Module Extension Configuration in the product roadmap for a future release (and, if so, when)?
Thanks
-
0
Hello,
The team says, there is no roadmap for this feature for CmsKit Module. FYI
Regards.
-
0
Due to the restriction above, I am trying to add a Language (extra) property to the CMS Page object. Please confirm the steps:
- I added the extra property in the AppDomainModule: ObjectExtensionManager.Instance .AddOrUpdate<Page>(options => { options.AddOrUpdateProperty<string>("Language", options => { options.DefaultValue = "en"; }); } );
- I mapped the property to a column in AppEfCoreEntityExtensionMappings ObjectExtensionManager.Instance .AddOrUpdateProperty<Page, string>( "Language", options => { options.MapEfCore(b => b.HasMaxLength(10)); } );
- I created and ran the migration successfully to add the Language column to the CmsPage table
- I copied the Razor / Admin pages from the CmsKit source code (retrieved using get-source) and copied into my Web project's Pages/CmsKit/Pages folder and renamed the model classes and updated the @model to reference the new class names
- I customized the .cshtml views to include the new Language field.
How do I update the services and DTOs to return the updated Page/PageDto with the new field? I was thinking of trying CreateMap<Page, PageDto>().MapExtraProperties(); but I get a compile time error: The type 'Volo.CmsKit.Admin.Pages.PageDto' must be convertible to 'Volo.Abp.Data.IHasExtraProperties' in order to use it as parameter
Please advise on next steps to allow CmsKit to support an extra property in the Page object. Thanks!
-
0
Hi Matt,
Could you please check whether you inherited
ExtensibleEntityDto
or not toPageDto
?I know you have looked at it here, but could you look at it again, please?
MapExtraPropertiesTo is an extension method provided by the ABP Framework to copy extra properties from an object to another in a controlled manner
Regards.