More in this section

Forums / Developing with Sitefinity / Adding Content Backend fields

Adding Content Backend fields

2 posts, 0 answered
  1. Gagandeep
    Gagandeep avatar
    8 posts
    29 Nov 2011
    19 Dec 2011
    Link to this post

    I have added a new backend field in Content block from using this:

    Find Controls > ContentBackend > Views > ContentBackendInsert / ContentBackendEdit > Sections > MainSection > Fields. ContentBackendInsert is the name of the view used to insert content items, while ContentBackendEdit is the view for editing.

    Now, I have the field added in the backend to be inserted into the database also. I found a code snippet:

                        .TryCreateNew("BranchName", typeof(string))

    I want this code to be written on the SaveChanges event of 'CreateNewContentBlock'.
    Where can i get this event in the code behind.

    Thanks & Regards,

  2. Boyko Karadzhov
    Boyko Karadzhov avatar
    56 posts
    05 Dec 2016
    22 Dec 2011
    Link to this post

    This task is achievable with External Scripts. This is a relevant thread: 

    You can create a service that executes your code snippet and an external script for the ContentBackendInsert view that makes the service call.

    You can register your script through Administration -> Settings -> Advanced -> Content -> Controls -> ContentBackend -> Views -> ContentBackendInsert -> Scripts.

    The event you need is onSaved  ( this._binder.add_onSaved([your method here]) ).

    Boyko Karadzhov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered