【问题标题】:OctoberCMS -> Access to a different Pages->Content TabOctoberCMS -> 访问不同的页面 -> 内容选项卡
【发布时间】:2017-09-05 13:43:21
【问题描述】:

我有一个小问题。我创建了一个部分,它给了我所有的页面。现在我想给出来自不同页面的内容。所有页面都有一个名为“图像”的选项卡,但我不知道如何访问


布局

{% for child in page.getChildren %}
    <li class="list-group-item">
        <span>
            <!-- Here the Content of the Tab "Image" -->
        </span>                        
        <a href="{{ child.url|app }}">
            ClickMe
        </a>
    </li>
{% endfor %}

页面

那么你能帮我访问正确的标签吗?我已经尝试过这些(但我只能访问内容选项卡)

{{ child.content }} 

这对我不起作用

{{ child.Tab.Image }}

{{ child.Image }}

【问题讨论】:

  • 你是怎么把标签放在那里的?
  • 我在布局中创建了这个 {% placeholder Image %}
  • 您想在每个链接上附加一张图片吗?

标签: laravel twig octobercms


【解决方案1】:

如果使用占位符,则只能在后端新创建的选项卡中插入文本。在您的页面中创建图像自定义字段的最佳方法(我假设您正在使用静态页面插件,就像您的照片所建议的那样)是使用以下语法:

{variable name="image" label="Image" tab="The name of your tab here" type="mediafinder" mode="image"}{/variable}

记得把这段代码放在你的布局文件中。

您可以在插件文档herehere 中找到您的所有需求。 请记住,您可以使用 OctoberCMS 的所有内置表单字段(是的,还有中继器!)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-30
    相关资源
    最近更新 更多