2017-05-04 23 views
4

我有「特色」的重複組,這樣 enter image description here在CrafterCMS中,如何將ICE添加到重複組中的項目?

我希望能夠做出一個在上下文編輯彈出編輯僅此單一特徵。

我的模板的代碼是這樣的

<#import "/templates/system/common/cstudio-support.ftl" as studio/> 

<div class="container about_content center p-b-3 wow fadeInUp" data-wow-duration="700ms" <@studio.componentAttr path=contentModel.storeUrl /> > 
    <div class="row"> 
    <#list contentModel.features.item as feature> 
     <div class="col-md-4" <@studio.iceAttr iceGroup="feature" path=contentModel.storeUrl label="Feature" /> > 
     <div class="single_abt single_about m-y-3"> 
      <i class="fa"> 
      <img src="${feature.logo}" /> 
      </i> 
      <h3>${feature.title}</h3> 
      <p>${feature.description!}</p> 
     </div> 
     </div> 
    </#list> 
    </div> 
</div> 

回答

6

在CrafterCMS,如果你喜歡的功能是可編輯的單獨,而不是作爲一個羣體,那麼他們就需要被定義爲單個組件。

看看附帶3.0版本的編輯藍圖,它擁有的是呈現爲組件與ICE標籤一起的功能列表:https://github.com/craftercms/studio/blob/master/src/main/webapp/repo-bootstrap/global/blueprints/website_editorial/templates/web/pages/home.ftl

注意的部分:

<section <@studio.iceAttr iceGroup="features"/>> 
    <header class="major"> 
     <h2>${contentModel.features_title}</h2> 
    </header> 
    <div class="features" <@studio.componentContainerAttr target="features" objectId=contentModel.objectId/>> 
     <#if contentModel.features?? && contentModel.features.item??> 
      <#list contentModel.features.item as feature> 
       <@renderComponent component=feature /> 
      </#list> 
     </#if> 
    </div> 
</section> 

它實質上迭代遍歷渲染它們的組件列表。

有關更多詳細信息,請參閱文檔中的ICE:http://docs.craftercms.org/en/3.0/developers/in-context-editing.html

相關問題