代码之家  ›  专栏  ›  技术社区  ›  user500665

类型3是否换行两列?

  •  0
  • user500665  · 技术社区  · 7 年前

    在模板设置中,我设置了两列,如下所示:

    column1 < styles.content.get
    column1.select.where = colPos = 1
    column1.stdWrap {
      wrap = <div>|</div>
      required = 1
    }
    column2 < styles.content.get
    column2.select.where = colPos = 2
    column2.stdWrap {
      wrap = <div>|</div>
      required = 1
    }
    

    这将使用div包装列,但仅当其中有内容时。

    如果两列中至少有一列包含内容,是否有方法将其环绕?

    :empty {display:none;} :empty 并非处处都支持。

    1 回复  |  直到 7 年前
        1
  •  1
  •   Bernd Wilke πφ    7 年前


    要么在打字稿中定义COA:

    column_1_and_2 = COA
    column_1_and_2.10 < .column1
    column_1_and_2.20 < .column2
    column_1_and_2.wrap = <div>|</div>
    

    或者在流体中使用一点逻辑:

    <f:if condition="{column1}{column2}">
        <div>
            {column1->f:format.raw()}
            {column2->f:format.raw()}
        </div>
    </f:if>