【发布时间】:2019-10-01 19:15:50
【问题描述】:
仅当内容编辑器选择将字幕组件添加到页面时,我想将一个类应用于我在 Magnolia 中的标题组件。我在下面尝试做的示例:
[#assign subtitle = "somehow get a reference to the subtitle component"]
[#assign subtitleExists = subtitle?has_content]
<div class="title ${subtitleExists?then('removePadding','')}">
${model.render('titleCopy')!}
</div>
这可能吗?如果需要,我很高兴添加更多信息以帮助澄清我在这里尝试做的事情。谢谢!
【问题讨论】:
标签: freemarker magnolia