John K
John K

Reputation: 28917

What is the Recommended Approach for Hosting Transformations when creating a Custom Module?

In Kentico 11, in a custom module you are developing, when using a custom Page Template (portal mode) for the UI Element, where is the appropriate place to host Transformations used by web parts of that template? "Appropriate" meaning the transformations can be bundled with the module for import/export operations or at least grouped with it logically in Kentico admin?

The Kentico Custom Module app doesn't contain a Transformations tab for its Classes. Repeater web parts used on the UI page template only list Custom Tables and Page Types when looking for transformations. Transformation doesn't seem to be supported for a Custom Class.

I could create a standalone container Page Type to host all transformations for the module, however this would be outside the module. These transformations would use data from Classes in the module (through repeater web parts and query data sources for example). It seems odd to put them outside so I am suspicious of doing this.

Up until now I've only used the out-of-box tab and listing web parts to create custom modules. Now I need to get into more customization, and prefer the portal mode to easily build templates using web parts. Transformations seem to be the missing consideration in this development flow.

Neither can I find Transformations mentioned in the Custom Module documentation. Kentico Documentation I'm referencing is:

I can find a place to put my transformations. I'm looking for thoughts about where to best put them and bundle them with my custom module work.

Upvotes: 0

Views: 108

Answers (4)

vasu yerramsetti
vasu yerramsetti

Reputation: 61

@John,

As per Brenden post, you can achieve this using custom web part with your custom logic.

Refer below URL:

https://docs.kentico.com/k10/developing-websites/defining-website-content-structure

Upvotes: -2

Peter Mogilnitski
Peter Mogilnitski

Reputation: 998

I suggest you to take a look at the custom table module as example, i.e. user interface part of it: there is transformation menu item under edit custom table in the interface. Take a look on how it is done and try to clone/modify it for your own custom module. If you check the DB: cms_transformation table has TransformationClassID field. So transformation is attachable to a class - so you custom classes can have transformations attached. Honestly i've never done it, but this is the way how I would approach. I would keep apples with apples, oranges with oranges... yeah sure you can always create "container page type" and it will work, but i would play around with the custom module. You might need to create and extender in this case.

Upvotes: 0

Zach Perry
Zach Perry

Reputation: 756

If you look at page types you will see that Kentico does the custom page types to hold transformations. They have ones like RSS Transformations, E-Commerce Transformations, etc.

That is the way I have always done it also.

Upvotes: 1

Brenden Kehren
Brenden Kehren

Reputation: 6117

Your findings are a shortcoming in the module documentation. The documentation talks in great detail on how to build the module and display it within the Kentico UI but talks little to none on how to display that content outside of Kentico on the public facing website.

What you mentioned, using a custom Page Type as a container is a simple easy approach and I believe you can bundle this with your module. Yes it doesn't make sense but using this approach will allow you to have your custom queries to access the module data and display options (transformations).

You have another option to create custom webparts for this and package them with your module but I'd recommend against this because it takes away from the basic usage of Kentico and will require code maintenance and modifications for simple changes.

Upvotes: 1

Related Questions