Skip to content

Commit

Permalink
remove title and description fields from content fragment, only outpu…
Browse files Browse the repository at this point in the history
…t requested field.
  • Loading branch information
wildone committed Jun 2, 2021
1 parent b770cb2 commit 5fab7ed
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template data-sly-template.contentFragment="${@ fragment='The content fragment', fragmentPath='', wcmmode='WCM mode'}">
<article id="${fragment.id}"
class="cmp-contentfragment cmp-contentfragment--${fragment.name}"
data-cmp-contentfragment-model="${fragment.type}"
data-sly-attribute.data-cmp-contentfragment-path="${fragmentPath}"
data-json="${!wcmmode.disabled && fragment.editorJSON}"
data-cmp-data-layer="${fragment.data.json}">
<sly data-sly-test.isParagraphMode="${fragment.elements.size == 1 && fragment.elements[0].isMultiLine && properties.displayMode == 'singleText'}">
<sly data-sly-call="${paragraphs @ fragment=fragment}"></sly>
</sly>
<sly data-sly-test="${!isParagraphMode}">
<sly data-sly-call="${elements @ fragment=fragment, wcmmode=wcmmode}"></sly>
</sly>
</article>
</template>

<!-- This template should not be used/called by the content fragment list component -->
<template data-sly-template.paragraphs="${@ fragment='The content fragment'}">
<div class="cmp-contentfragment__elements">
<div data-sly-resource="${'par0' @ resourceType=fragment.gridResourceType}"></div>
<div data-sly-list="${fragment.paragraphs}">
${item @ context="html"}
<div data-sly-resource="${'par{0}' @ format=itemList.count, resourceType=fragment.gridResourceType}"></div>
</div>
</div>
</template>

<template data-sly-template.elements="${@ fragment='The content fragment', wcmmode='WCM mode'}">
<dl class="cmp-contentfragment__elements${!wcmmode.disabled ? ' cq-dd-contentfragment' : ''}"
data-sly-list.element="${fragment.elements}"
data-sly-use.elementTemplate="core/wcm/components/contentfragment/v1/contentfragment/element.html">
<sly data-sly-call="${elementTemplate.element @ element=element}"></sly>
</dl>
</template>

0 comments on commit 5fab7ed

Please sign in to comment.