简体   繁体   English

分类术语的CustomSortOrder(SharePoint 2010)

[英]CustomSortOrder for Taxonomy Term (Sharepoint 2010)

I'm trying to set a custom order for my term set "Cities" using the Term store management tool. 我正在尝试使用术语库管理工具为术语集“城市”设置自定义订单。

When the user creates a new content type which has the column "City", the cities from the term store are displayed in the correct order. 当用户创建具有“城市”列的新内容类型时,术语库中的城市将以正确的顺序显示。 But when I'm looking at the term store from code, the order is not correct at all. 但是,当我从代码中查看术语存储时,顺序根本不正确。 To get the term set I'm using this: 为了获得术语集,我使用了这个:

 TermCollection myTermCollection = term.Groups[taxonomyGroupName].TermSets[taxonomyListName].GetAllTerms();

The default order in the 'myTermCollection' is the creation order of the taxonomies. “ myTermCollection”中的默认顺序是分类法的创建顺序。 The order listed in the property "CustomSortOrder" is alphabeticall. 属性“ CustomSortOrder”中列出的顺序为字母顺序。 None of them are the correct one set using the term store management tool. 使用术语商店管理工具,它们都不是正确的一套。

I ran manually the Taxonomy Update Scheduler, and the job works fine since I saw taxonomy names being updated correctly after running this, but the order is still not right. 我手动运行了分类法更新调度程序,该工作正常运行,因为运行此程序后我看到分类法名称已正确更新,但是顺序仍然不正确。

Any ideas are very much appreciated! 任何想法都非常感谢!

It was so simple! 太简单了!

In order to get the custom order, I was doing: 为了获得自定义订单,我正在做:

TermCollection myTermCollection = term.Groups[taxonomyGroupName].TermSets[taxonomyListName].GetAllTerms();
orderList = myTermCollection[0].CustomSortOrder;

Instead, I had to do 相反,我不得不

TermCollection myTermCollection = term.Groups[taxonomyGroupName].TermSets[taxonomyListName].GetAllTerms();
orderList = myTermCollection[0].TermSet.CustomSortOrder;

I'm not sure for what myTermCollection[0].CustomSortOrder stands for, but it's not what I need. 我不确定myTermCollection [0] .CustomSortOrder代表什么,但这不是我所需要的。 What I need is myTermCollection[0].TermSet.CustomSortOrder. 我需要的是myTermCollection [0] .TermSet.CustomSortOrder。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Microsoft.Sharepoint.Client.Taxonomy.dll从Sharepoint 2010 Server获取TaxonomySession TermStore TermSet术语 - Get TaxonomySession TermStore TermSet Term from Sharepoint 2010 Server using Microsoft.Sharepoint.Client.Taxonomy.dll 如何在不使用 sharepoint 2010 中的分类字段控件的情况下将术语集分配给页面布局 - How to assign a Term Sets to a Page layout on saving with out using taxonomy field control in sharepoint 2010 Sharepoint 2010分类法未正确过滤 - Sharepoint 2010 Taxonomy not filtering correctly 使用分类术语更新SharePoint用户配置文件属性 - Updating SharePoint User Profile Property with a Taxonomy Term SharePoint 2010分类控制多重价值 - SharePoint 2010 Taxonomy Control Multi Value SharePoint内容查询,分类术语库和XSL转换 - SharePoint Content Query, Taxonomy term store and XSL transformation 如何在SharePoint 2010 EditModePanel中显示正确的分类法控件? - How do I show the correct Taxonomy control in a SharePoint 2010 EditModePanel? Sharepoint 2010客户模型。 在分类法字段中设置多个值 - Sharepoint 2010 client model. Set multiple values in taxonomy field 从PHP访问SharePoint 2010分类标准Web服务 - Accessing SharePoint 2010 Taxonomy web service from PHP 在SharePoint 2010中获取用户配置文件属性的术语集 - Getting term set of a user profile property in SharePoint 2010
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM