2014-10-08 73 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的首選方式。