More in this section

Forums / Developing with Sitefinity / Meta fields and caching issues in management

Meta fields and caching issues in management

5 posts, 0 answered
  1. Nigel
    Nigel avatar
    38 posts
    Registered:
    01 Dec 2004
    05 Jun 2008
    Link to this post
    Hello!

    I've got a custom blog provider that has a number of custom meta fields which are managed, obviously, through customised ControlPanelEdit and Insert templates.

    To of these fields relate to rating the "post". Through some AJAX goodness, readers of a post can star rate it. This is tracked against the post using meta fields "Rating" and "RatingCount". The client requires that they can tweak the rating, if need be, through management. However, the updated values of these two meta fields (once they've been set by site visitors), are not reflected on ControlPanelEdit template. The last values for these fields as set by management are always shown.

    It probably sounds like a minor issue, but the problem is, when ever a post gets edited, the actual rating values are getting overwritten by the cached values in management. This is giving me all kinds of headache. So huge gratitude to anyone who has a solution!

    BTW, running latest SF service pack.
  2. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    06 Jun 2008
    Link to this post
    Hello Nigel,

    I think you should post some more information about the way you are implementing your logic.

    In my opinion the problem might hide in two places. One is the way you get and save the content in the public control. The place where visitors can rate your posts. Actually, there are some small differences in the GetContent, GetStagedContent, as well as in the SaveContent and PublishContent, which might reference this problem in particular. The other problem might be hidden in the way you present the ratings in the edit and insert templates of the administrative part. If you are using some custom controls they might not be fulfilled as the templates would expect controls which implement the ITextControl interface.

    These are my two cents on the matter, as I cannot give you a concrete solution for the information given, don't know what's the others think.

    Kind regards,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Nigel
    Nigel avatar
    38 posts
    Registered:
    01 Dec 2004
    11 Jun 2008
    Link to this post
    Hi Vassil

    Thanks for your reply. Hopefully the following information will clarify things a bit.

    Rating and RatingCount are ShortText meta fields for my provider. In the Admin control templates they are presented in the standard asp:Textbox.

    As for the rating mechanism on the users side, this is done with Javascript / AJAX that calls my own custom handler. This checks ratings for uniqueness and stores in a custom db table. An SQL stored procedure then gets averages and counts from the custom db table and updates the 2 short text values for the relevant content in sf_GCMetaData.
  4. Nigel
    Nigel avatar
    38 posts
    Registered:
    01 Dec 2004
    18 Jun 2008
    Link to this post
    Hi Vassil

    Were you able to offer any further suggestions?

    Thanks.
  5. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    23 Jun 2008
    Link to this post
    Hello Nigel,

    I am sorry for the late reply.

    Most probably, the problem you encounter is due to some bad logic in the public part implementation. As you don't say which methods you use for getting and saving the content, I would suggest you get the content via the GetStagedContent method and save it with the SaveContent method. So your code looks

    IContent cnt =

    manager.GetStagedContent(yourItemId);

    //Some logic which updates the content



    manager.SaveContent(cnt);

    Please try the code above and see whether it does the job. Let us know if this is not the case.

    Sincerely yours,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
5 posts, 0 answered