2014-10-08 76 views
5

我正在使用Unicorn将项目序列化到我的本地文件系统。在这个配置中,我有一个包含很多项目的集合。这些项目不必序列化到我的文件系统,但根文件夹应该。Sitecore独角兽项目同步

所以我包含了根文件夹,但是如何配置Unicorn跳过它的子项呢?

<include database="master" path="/sitecore/content/mycollection" /> 

我希望像

<include database="master" path="/sitecore/content/mycollection" excludeChilds="true /> 

<include database="master" path="/sitecore/content/mycollection"><exclude "*" /></include> 

回答

4

这是不可能的你建议的方式,虽然它不似乎很难看代码以这种方式实施。但是按模板排除不必要的项目可能会很有用。这可以通过在include标签中添加以下排除标签来实现。

<exclude template="Page" /> 
<exclude templateid="{8EF706F3-71D1-4EE2-BADF-99018AF186C9}" /> 
+0

集合是存储桶,其中包含存储桶文件夹。 – 2014-10-09 07:13:07

+0

不可能排除项目,因为它是一个项目存储桶。我还必须排除项目存储桶文件夹模板,但这与我的应用程序中的其他存储桶发生冲突。 – 2014-10-09 07:15:16

+0

Sander,如果您在该路径的include-tags中添加了项目存储桶文件夹模板,则只有包含路径下具有该模板的子项目才会被忽略。 – 2014-10-09 08:21:51

0

在麒麟3.1

<include database="master" path="/sitecore/content/mycollection"> 
    <exclude children="true" /> 
</include> 

来源:https://kamsar.net/index.php/2016/01/Unicorn-3-1-Released/

注:elkaz用斜线回答也工作,但这是根据kamsar的博客文章,因为3.1的首选方式。