More in this section

Forums / Developing with Sitefinity / Custom metafields for Gereic Content

Custom metafields for Gereic Content

3 posts, 0 answered
  1. Priti
    Priti avatar
    17 posts
    Registered:
    20 Nov 2008
    10 Dec 2008
    Link to this post
    Hi,

    I found this vedio on Sitefinity 
    Using custom meta fields with content
    at http://www.sitefinity.com/product/videos.aspx

    I found this a very exciting feature. I could add new field to News content item by following steps discussed in the above vedio.

    But when I tried doing same thing for Generic content item, it is not saving the data for the new fields. Here is what I did,
    1. 1. I first added new key in <metafields> in Web.config
    2. 2. I opened the ControlPanelInsert.ascx and added markup for new field.
    3. 3. I did same with ControlPanelEdit.ascx
    4. 4. I wnet to Sitfinity admin and created new content item. I could see the new field appearing in the Content insert form. I entered all the required values and clicked on Create this item
    5. 5. It saved the content item but the value in new field is not saved. It is showing it blank
    6. 6. I tried to edit the same content item. Value in new field is empty and if I enter something in it and save. It saves without error but value is not persisted.
      1. Is it not possible to add custom meta fields to Generic Content?
      Or I am I missing something here?

      Please help.

      Thanks,
      Priti.

  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    10 Dec 2008
    Link to this post
    Hi Priti,

    Unfortunately, we cannot reproduce the described behavior locally. Note that in Insert/Edit templates you can use only controls which implement ITextControl interface (for example TextBox control). Also, the ID of the control should be equal to the meta key for which you wish to use it. Otherwise, the value of the meta field will not be saved. If everything is properly set, please send us your web.config file and the control panel templates (ControlPanelInsert.ascx and ControlPanelEdit.ascx) to test the issue locally.

    Thanks for your cooperation in advance.

    All the best,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Priti
    Priti avatar
    17 posts
    Registered:
    20 Nov 2008
    10 Dec 2008
    Link to this post
    Hi Pepi,

    Thanks for the reply.
    The problem is sorted out now. I had taken all the care that you had mentioned in your replay but problem was the location where I had added my TextBox for new field in the panel template code.  I had missed on the ItemTemplate of ContentMetaFields part. Now I have moved my code inside the ItemTemplate of ContentMetaFields and it started working fine. 

    This is really very nice feature. I was not sure whether it is also allowed for Generic Content but it's nice that we can use this on Generic Content also.

    Thanks for your support.

    Priti.


     

Register for webinar
3 posts, 0 answered