-
Notifications
You must be signed in to change notification settings - Fork 732
/
templates.html
55 lines (51 loc) · 2.86 KB
/
templates.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2019 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<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}">
<h3 class="cmp-contentfragment__title">${fragment.title}</h3>
<sly data-sly-test="${fragment.description}">
<p class="cmp-contentfragment__description">${fragment.description}</p>
</sly>
<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>