Sna*_*per 1 datasource sitecore treelist sitecore7
我有一个treelist字段,我想将数据源设置为3个文件夹pe:
/sitecore/Website/News/
/sitecore/Website/Events/
/sitecore/Website/Articles/
Run Code Online (Sandbox Code Playgroud)
在网站项下有更多"文件夹".
我搜索并花了几个小时尝试不同的方法,但似乎没有工作.
这可能吗?我需要扩展这个领域吗?
先感谢您
不久前,我写了一篇博客文章,介绍了控制多列表和树状列表字段(有搜索和无搜索)的数据源的不同方法.为搜索字段列出的第三种技术是我认为您正在寻找的:
在内容树的两个或多个位置搜索(带搜索的字段):
StartSearchLocation={110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}&Filter=_path:110d559fdea542ea9c1c8a5df7e70ef9|_path:3d6658d8a0bf4e75b3e2d050fabcf4e1
Run Code Online (Sandbox Code Playgroud)
为了您的实施:
StartSearchLocation={Website.ID}&Filter=_path:[News.ID (guid form; no brackets)]|_path:[Events.ID (guid form; no brackets)]|_path:[Articles.ID (guid form; no brackets)]
Run Code Online (Sandbox Code Playgroud)
在内容树的两个或多个位置搜索(没有搜索的字段):
如果您使用的是Multilist字段(没有搜索),那么我会执行以下操作:
DataSource=/path/to/source/1|/path/to/source/2
Run Code Online (Sandbox Code Playgroud)
为了您的实施:
DataSource=/sitecore/website/news|/sitecore/website/events|/sitecore/website/articles
Run Code Online (Sandbox Code Playgroud)
我还要补充说,Treelist with Search字段已在Sitecore 7的更高版本中弃用,因此,如果这是您正在使用的字段,那么我建议您使用" 搜索"字段更改为"多列表" .如果您使用标准的Treelist字段,那么Ahmed的答案也可能是可行的,具体取决于您的使用案例.
如果您有任何疑问,请告诉我.祝你好运,编码愉快!:)
| 归档时间: |
|
| 查看次数: |
3188 次 |
| 最近记录: |