Passing variable to Octobercms blogPosts component using a Repeater markup

做~自己de王妃 提交于 2019-12-13 05:41:18

问题


On Octobercms blogPosts component I want to pass a variable. I want to change postsPerPage value using:

{repeater name="fields" groups="~/themes/demo/myfields.yaml" tab="MyFields"}
{/repeater}

on static layout.

myfields.yaml

blogfield:
    name: Blog Field
    description: My Blog Field
    fields:
        fields_blog_number:
            label: Posts Number
            type: number
            span: right

And I render it with:

{% for field in fields%}
...
{% endfor %}

So i want to be able to change postsPerPage component value with this field on static Pages.

I use a partial with blogPosts component.

I try to insert a number in my field on my static page but is not working. Any idea on how can I pass variables on component?

来源:https://stackoverflow.com/questions/55421938/passing-variable-to-octobercms-blogposts-component-using-a-repeater-markup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!