【问题标题】:Set max result to octobercms repeater将最大结果设置为 octobercms 中继器
【发布时间】:2017-02-08 10:39:40
【问题描述】:

我有下面的中继器

{repeater name="gallery" prompt="Add another image" tab="Gallery"}
{variable type="mediafinder" name="image" label="Image" type="mediafinder" mode="image"}{/variable}
{variable type="text" name="title" label="Title"}{/variable}
{variable type="text" name="description" label="Description"}{/variable}
{variable type="richeditor" name="button" label="Button Link" toolbarButtons="insertLink" size="small"}{/variable}
{/repeater}

我可以设置重复的最大结果吗?

例如,如果设置 max=3 重复画廊。每当数量达到 3 时,不会出现提示“添加另一个图像”

【问题讨论】:

    标签: octobercms


    【解决方案1】:

    目前不存在此功能。请求它的最佳位置是 October CMS GitHub issues register,或者更好的是,您可以提交一个 Pull Request 以添加它。

    【讨论】:

      【解决方案2】:

      添加限制器,例如3:

      maxItems="3"
      
      {repeater name="gallery" prompt="Add another image" tab="Gallery" maxItems="3"}
      

      【讨论】:

        猜你喜欢
        • 2011-12-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-05-14
        • 1970-01-01
        • 2020-07-27
        • 2017-07-28
        相关资源
        最近更新 更多