【问题标题】:OctoberCMS repeater doesn't render data in static pageOctoberCMS 转发器不在静态页面中呈现数据
【发布时间】:2018-07-31 09:28:26
【问题描述】:

几天前我开始使用OctoberCMS,我正在尝试使用repeater 标签。下面的代码写在我的 layout.htm 文件(CMS TAB)中。

<body>
<!-- HEADER PARTIAL -->

<!-- generate the content -->
{% page %}
<div>
{repeater name="item" prompt="Add item"}
    <div class="article-container">
        <div class="carousel-container">
            <img />
            <img /> <!-- add X-amount of Images to the carousel -->
            <img />
            <button class="btn-small">prev</button>
            <button class="btn-small">next</button>
        </div>

        <article>
            <header>{text name="title" label="Title"}Title{/text}</header>
            <p>{textarea name="description" label="Description"}Description{/textarea}</p>
            <button class="btn-gradient">{text name="buttonText" label="ButtonText"}ButtonText{/text}</button>
        </article>
    </div>
{/repeater}
</div>
<!-- content generated -->

<!-- FOOTER PARTIAL -->
<!-- SCRIPTS -->
</body>

在 Rainlab 的静态页面中 -> 页面 (PAGE TAB) -> 选择的页面:我可以在“其他”选项卡中看到此转发器。

当我填写字段并保存时,我看不到静态页面中呈现的内容。我看到的只是一个空的 div,它包裹在转发器标签周围。我究竟做错了什么?如何在我的静态页面中呈现此内容?我在静态 page.htm 文件的 viewbag 中看到了添加的键和值。

感谢您的宝贵时间。

【问题讨论】:

    标签: repeater octobercms octobercms-backend


    【解决方案1】:

    我相信这是一个已修复的错误。它现在突然起作用了......我没有改变任何东西。

    【讨论】:

      猜你喜欢
      • 2016-10-21
      • 2018-05-24
      • 2014-02-09
      • 2019-10-14
      • 1970-01-01
      • 1970-01-01
      • 2021-01-13
      • 2012-12-17
      • 1970-01-01
      相关资源
      最近更新 更多