Are there any way to edit the default limit of ten terms in the termstore view?
-
Yes, with PowerShell :-)– Benny Skogberg ♦Mar 18, 2015 at 20:36
-
Hi, just curious, have you seen my answer? :)– Vadim GremyachevMar 19, 2015 at 11:57
-
1@VadimGremyachev I have, I will start working with that solution during friday, I'll keep you posted. Thanks!– Eric HerlitzMar 19, 2015 at 12:49
2 Answers
Microsoft.SharePoint.Taxonomy.Tree
JavaScript control (treecontrol.js
) is intended for rendering Taxonomy tree control. Microsoft.SharePoint.Taxonomy.Tree PageLimit
property defines the number of visible terms.
You could consider the following solution to override default (10) PageLimit
property value:
ExecuteOrDelayUntilScriptLoaded(function(){
Microsoft.SharePoint.Taxonomy.Tree.prototype.set_pageLimit(15);
},
'treecontrol.js');
The example demonstrates how to make 15
terms visible when TermSet is expanded.
In order to apply the changes per web/site:
- Save the specified code into
treecontrol.settings.js
file and upload it into for example intoStyle Library
- Reference the specified file in master page
The solution is compatible with SharePoint 2010/2013 and Online versions
Result
-
This looks like it is in Site settings > Term store management. Does this also work in the controls that users see? Can it be expanded to realistic limits like 50?– RothrockMar 31, 2015 at 22:54
I had to do something similar to what Vadim suggested in order to fix the modal dialog box when users are editing metadata fields.
NOTE: for Sharepoint 2013
put a file in styles library like: custom.sharepoint.behaviours.js
contents:
/* belongs in styles library */ function CustomSPBehaviours() { // console.debug(["custom.sharepoint.behaviours", Microsoft.SharePoint.Taxonomy]); if(typeof(Microsoft.SharePoint.Taxonomy.Tree)=='undefined') return; Microsoft.SharePoint.Taxonomy.Tree.prototype.set_pageLimit(30); }; SP.SOD.executeFunc('treecontrol.js', 'SP.ClientContext', CustomSPBehaviours);
add this line before the ending body tag of master.template
<script type="text/javascript"; src="/sites/mysharepointsite/Style%20Library/custom.sharepoint.behaviours.js"></script>
add the same line to the file (prior to the last ending asp:content tag
)
c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\WebTaggingDialog.aspx
the WebTaggingdialog change is needed because the Term Set Picker is a modal dialog box that initalizes treecontrol
In my situation I had a bunch of hidden terms and the paginations were returning only a few selectable items as the hidden terms were taking up the remaining spots...