首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IBM-WCM插件-如果提供图像,则逻辑需要显示图像,否则使用视频

IBM-WCM插件-如果提供图像,则逻辑需要显示图像,否则使用视频
EN

Stack Overflow用户
提问于 2019-05-01 03:00:09
回答 1查看 200关注 0票数 0

我是一个使用IBM-WCM Websphere Portal 8.5.0的新开发人员。IBM网站上的一些文档很难理解。我正在尝试允许内容作者使用图像而不是视频。因此,如果静止图像不是空的,则使用视频。

我尝试过使用不同的插件。示例- [Plugin:IfNotEmpty="Element context='current‘type='content’key=‘section_1_hero_image_key’“]。我将密钥设置为他们将在创作模板上上传的图像的标题。

代码语言:javascript
复制
   <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>
EN

回答 1

Stack Overflow用户

发布于 2019-05-13 18:27:53

你所做的是正确的。没有其他逻辑,必须使用Plugin:ifNotEmpty和Plugin:ifEmpty标记来实现。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55927210

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档