Custom Field to Blog - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Custom Field to Blog

  • Custom Field to Blog
  • 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?
  • 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

    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.