我是一个使用IBM-WCM Websphere Portal 8.5.0的新开发人员。IBM网站上的一些文档很难理解。我正在尝试允许内容作者使用图像而不是视频。因此,如果静止图像不是空的,则使用视频。
我尝试过使用不同的插件。示例- [Plugin:IfNotEmpty="Element context='current‘type='content’key=‘section_1_hero_image_key’“]。我将密钥设置为他们将在创作模板上上传的图像的标题。
<div class="video-container show-for-medium">
[Plugin:ifNotEmpty value="[Element context='current' type='content' key='section_1_hero_image_still']"]
<img width="100%" src="[Element context='current' type='content' key='section_1_hero_image_still']" alt="[Element context='current' type='content' key='Hero Image']"/>
[/Plugin:ifNotEmpty]
[Plugin:ifEmpty value="[Element context='current' type='content' key='section_1_hero_image_still']"]
<video alt="Hero Image" aria-hidden="true" poster="" width="100%" muted="" loop="" autoplay="">
<source src="[Element context="current" type="content" key="section_1_hero_video_mp4"]">
</video>
[/Plugin:ifEmpty]
</div>发布于 2019-05-13 18:27:53
你所做的是正确的。没有其他逻辑,必须使用Plugin:ifNotEmpty和Plugin:ifEmpty标记来实现。
https://stackoverflow.com/questions/55927210
复制相似问题