3

Can anyone tell me which function or part of the code I have to override from SP.UI.discussion.js to display extra fields in subject view of discussion board? Other than the fields it has OOTB.

1 Answer 1

1

You can find a good example in the following blog post: http://aroundsharepoint.blogspot.co.at/2012/11/sharepoint-2013-add-geolocation-field.html

But I think the functions in the blog post are not the correct one. As far as I could find out, the correct one are:

$2z_0: function SP_UI_Discussions_PostBehavior$$2z_0($p0){} and
$2v_0: function SP_UI_Discussions_PostBehavior$$2v_0($p0, $p1)
5
  • Hi, is the code inside the fucntions correct? as you are saying they have mentioned the wrong functions because I am not able to make it work. Thanks and Regards, Alamzeb Jun 23, 2014 at 7:52
  • For me the code worked just fine.Did you replace the column names in the JS code in the article?
    – Andreas
    Jun 25, 2014 at 13:57
  • Ah. Another possible problem: SharePoint does some kind of caching with these JS files on the server side. Try the following: edit the discussion list webpart, select a different view (e.g. management), save it, switch back to the subjects view and save the webpart again. This should lead to a reloading of the JS file. I hope you dont forgot to add your custom field to the viewfields in the JS (just search for "<ViewFields>", just a simple CAML, you should know what to do about it)
    – Andreas
    Jun 25, 2014 at 14:17
  • well it is working now.. Thanks alot, but don't know why if I customize the sharepoint default subject view or create the new custom subject, the navigation is broken. Rather than opening itemdetail(Flatview of discussionboard) when clicking on any discussion title, it tries to open the itemdetail in the same subject view. Do you have any idea about this? Jul 1, 2014 at 8:15
  • I can't seem to use this technique all the way: Since I don't want to damage my discussions rendering on the entire Web App, I've copied "SP.UI.discussion.js" locally into some folder of my site collection root site, and changed the path to /sites/MYSITE/FOLDER/SP.UI.discussion.js in allItems.aspx, using SP Designer. I don't get an error (hurray!) but the rendering is completely different now. It doesn't look like those fancy SharePoint discussions anymore, only like a normal list display (with all the columns). What did I do wrong? Oct 16, 2018 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.