In CrafterCMS, how can I add an ICE to an element in a repeating group?

I have a repeating Features group like this enter image description here

I would like to be able to pop up the In Context Editing popup only this single function.

My template code is like this

<#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>
+4
source share
1 answer

In CrafterCMS, if you want functions to be edited individually rather than as a group, then you need to define them as separate components.

, 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

+6

Source: https://habr.com/ru/post/1676401/


All Articles