【问题标题】:IBM-WCM Plugin-logic need to display image if provided else use videoIBM-WCM Plugin-logic 需要显示图像,否则使用视频
【发布时间】:2019-04-30 19:00:08
【问题描述】:

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

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

   <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>

【问题讨论】:

    标签: html logic websphere ibm-wcm


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-28
      • 2017-05-15
      • 1970-01-01
      • 1970-01-01
      • 2022-07-28
      • 2017-08-04
      相关资源
      最近更新 更多