+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Custom Field to Blog

Custom Field to Blog

2 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    07 Feb 2011
    Link to this post
    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?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    08 Feb 2011
    Link to this post
    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.
2 posts, 0 answered