Sitecore Unicorn项目同步

San*_*ter 5 sitecore sitecore-unicorn

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

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

<include database="master" path="/sitecore/content/mycollection" />
Run Code Online (Sandbox Code Playgroud)

我希望有类似的东西

<include database="master" path="/sitecore/content/mycollection" excludeChilds="true />
Run Code Online (Sandbox Code Playgroud)

要么

<include database="master" path="/sitecore/content/mycollection"><exclude "*" /></include>
Run Code Online (Sandbox Code Playgroud)

elk*_*kaz 5

如果您使用的是Unicorn 3,现在可以通过添加尾部斜杠来跳过子项.

<include database="master" path="/sitecore/content">
    <exclude path="/sitecore/content/" />
</include>
Run Code Online (Sandbox Code Playgroud)

有关更多信息,请参阅:http://kamsar.net/index.php/category/Unicorn/#Exclude_all_children_with_the_predicate.


Tho*_*man 4

您提议的方式是不可能的,尽管查看以这种方式实现它的代码似乎并不难。但通过模板排除不必要的项目可能会很有用。这可以通过在包含标签内添加以下排除标签来实现。

<exclude template="Page" />
<exclude templateid="{8EF706F3-71D1-4EE2-BADF-99018AF186C9}" />
Run Code Online (Sandbox Code Playgroud)