【问题标题】:Modx: display all pages in one templateModx:在一个模板中显示所有页面
【发布时间】:2013-02-18 13:45:24
【问题描述】:

我想找到一种方法来调用一个模板中每个页面的[[*content]]。我的意思是一些仍然是动态的,以便我可以添加或删除页面,它会出现在菜单中而无需修改任何内容。

http://fr.wix.com/website-template/view/html/tokyo-design

我想在 modx 中使用这种导航。也许 getresource 是答案,但我需要显示如下内容:

<div>[[*contentpage1]]</div>
<div>[[*contentpage2]</div>
<div>[[*contentpage3]]</div>
...

有人可以帮我解决这个问题吗?

谢谢

【问题讨论】:

    标签: modx modx-revolution modx-templates


    【解决方案1】:

    听起来你在正确的轨道上,使用 GetResources 应该能够为你做到这一点:

    "

    [[!getResources:default=``? &parents=`0` &includeContent=`1` &tpl=`contentoutput`]]
    

    "

    然后创建一个名为“contentoutput”的新块,其中包含您要输出的代码,例如

    "

    <div>
    [[+content]]
    </div>
    

    "

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-19
      • 2016-05-26
      • 2016-03-10
      • 1970-01-01
      • 1970-01-01
      • 2018-10-11
      • 2019-09-28
      • 1970-01-01
      相关资源
      最近更新 更多