Custom Module Properties

Posted by Community Admin on 04-Aug-2018 22:48

Custom Module Properties

All Replies

Posted by Community Admin on 04-Apr-2012 00:00

So I am trying to create a custom module and have a custom widget template that displays said module. I made a custom module using the module builder but the "image"(Media Type) and "tags"(Classification Type) properties always come back null/empty. What's with that?

On the same line of thought, I would like to be able to have a strongly typed reference to the data item for the custom module. Is that possible? There is apparently a class dynamically created at runtime called "Telerik.Sitefinity.DynamicTypes.Model.Promos.Promo" where Promo is my custom module.

If these fields can't be populated by sitefinity code and we have to roll our own then how would we go about setting and getting the values to/from the DataItem?

Posted by Community Admin on 05-Apr-2012 00:00

Erik, are you trying to retrieve these field values programmaticaly via the API? If so, take a look at the "Binding to Fields" section of this post: Retrieving Data From Dynamic Modules Using the Module Builder API

Basically a helper method is used to extract the data from the API. Gabe used a similar approach (global helper method) to show the taxonomies on the details page for the Showcase Module example.

Regarding a strongly-typed reference to your module, that is currently not generated out of the box. You would need to implement your own wrapper for that around the existing API code.

This story is still being improved as the module builder evolves, and I'd like to thank you for your feedback, and I hope that this info was helpful to you!

This thread is closed