简体   繁体   English

Umbraco 7 限制可能的标签值

[英]Umbraco 7 Limiting possible Tags values

On our website, it is possible to tag content by a country list.在我们的网站上,可以按国家/地区列表标记内容。 This country list could be implemented as a tag control but I'm concerned about mis-spellings creeping in over time.该国家/地区列表可以作为标签控件实施,但我担心随着时间的推移会出现拼写错误。 However, the country list is very long (150+) so not ideal for a dropdown multiple control either.但是,国家/地区列表很长(150+),因此也不适合下拉多重控件。

What I'm looking to do is have a control that has the same type + autocomplete functionality as the existing tags control but limit the possible values to those retrieved from a database table.我想要做的是有一个控件,它具有与现有标签控件相同的类型 + 自动完成功能,但将可能的值限制为从数据库表中检索到的值。

I also want to be able to list all tags that a piece of content has been tagged against as well as searching for content based on tags eg GetNodesWithTags我还希望能够列出一段内容被标记的所有标签,以及基于标签搜索内容,例如 GetNodesWithTags

Has anyone developed anything like this before?以前有人开发过这样的东西吗? I've had a look at packages etc but can't see anything similar.我看过包等,但看不到任何类似的东西。 Does anyone have any advice before I start off?在我开始之前,有人有什么建议吗?

Definitely, using Tags datatype for this may cause a lot of problems :)当然,为此使用标签数据类型可能会导致很多问题:)

In my opinion, the perfect solution will be to use nuPickers ( https://our.umbraco.org/projects/backoffice-extensions/nupickers/ ) package and available there TypeaheadList Picker .在我看来,完美的解决方案是使用nuPickers ( https://our.umbraco.org/projects/backoffice-extensions/nupickers/ ) 包,并在那里可用TypeaheadList Picker

Depending of your additional requirements, you may use Lucene index / C# accessed source (totally custom - db, static, enum etc.) / XML file source as a prevalues for your control.根据您的其他要求,您可以使用 Lucene 索引/C# 访问源(完全自定义 - db、静态、枚举等)/ XML 文件源作为您控件的预值。

在此处输入图片说明

Then, you'll be able to create logic which will enable you to perform search based on this field as it will be a typical property with value on the nodes.然后,您将能够创建逻辑,使您能够基于此字段执行搜索,因为它将是节点上具有值的典型属性。 Once again - suggested way is to use Lucene Examine index as it's tailored to be fast with searching.再次 - 建议的方法是使用 Lucene Examine 索引,因为它专为快速搜索而设计。 You can read more about searching with Examine here: https://our.umbraco.org/documentation/reference/searching/examine/ .您可以在此处阅读有关使用 Examine 进行搜索的更多信息: https : //our.umbraco.org/documentation/reference/searching/examine/

Hopefully it will solve your problem.希望它能解决你的问题。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM