Custom Field to Blog

Posted by Community Admin on 05-Aug-2018 00:59

Custom Field to Blog

All Replies

Posted by Community Admin on 07-Feb-2011 00:00
When I create a new blog post I'd like to have the option to specify an image in a textbox...and then in the list template I want to have it display in the same place everytime (so inside the ItemTemplate of the lsitview)

Can that be done in the UI?
Posted by Community Admin on 08-Feb-2011 00:00
Hi Steve,

This could be done with a custom Field control

1.  Implement your own FieldControl and use it when creating the custom field. That field control would be responsible for displaying the UI for selecting an image (from a library) and saving the value (ID or image URL, whatever you prefer) as the value of the custom field. You need to inherit from the Telerik.Sitefinity.Web.UI.Fields.FieldControl class, and your client component should inherit from the Telerik.Sitefinity.Web.UI.Fields.FieldControl sitefinity client component. Also, make sure you have overridden get_value() and set_value() client methods, which will be called by News module Create/Edit dialog.

2. Go to Design > Widget Templates and modify the corresponding News control template to use the newly created custom field.

You might find this post useful - Creating a Simple Image Selector Using a Client Binder

We will try to provide some more samples about this implementation as a blog post. There are ideas to include this in the Products sample catalog

Greetings,
Ivan Dimitrov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
This thread is closed