efa*_*faj 4 java content-management-system crafter-cms
我希望能够创建一个In Context Editing弹出框来仅编辑这个单一的功能.
我的模板代码是这样的
<#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>
Run Code Online (Sandbox Code Playgroud)
在CrafterCMS中,如果您希望功能可以单独编辑而不是作为一组编辑,那么它们需要被定义为单独的组件.
看一下3.0版附带的编辑蓝图,它有一个与ICE标签一起呈现为组件的功能列表:https://github.com/craftercms/studio/blob/master/src/main/webapp/回购引导/全球/蓝图/ website_editorial /模板/网页/网页/ 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>
Run Code Online (Sandbox Code Playgroud)
它基本上迭代了单独呈现它们的组件列表.
有关更多详细信息,您可以在文档中阅读ICE:http://docs.craftercms.org/en/3.0/developers/in-context-editing.html