Scroll 苏鲁:如何实施;“加载更多”;带智能内容的按钮?
所以我定义我的领域如下:Scroll 苏鲁:如何实施;“加载更多”;带智能内容的按钮?,scroll,sulu,Scroll,Sulu,所以我定义我的领域如下: <property name="news" type="smart_content"> <!-- @see https://docs.sulu.io/en/2.2/reference/content-types/smart_content.html --> <meta> <title lang="en"&g
<property name="news" type="smart_content">
<!-- @see https://docs.sulu.io/en/2.2/reference/content-types/smart_content.html -->
<meta>
<title lang="en">News</title>
<title lang="de">Nachrichten</title>
</meta>
<params>
<param name="provider" value="articles"/>
<param name="types" value="news"/>
</params>
</property>
新闻
德国天文学会
我的细枝模板看起来像:
<div>
{% for article in news %}
<a href="{{ sulu_content_path(article.routePath) }}" >
<h2>
{{ article.excerpt.title|default(article.title) }}
</h2>
</a>
{% endfor %}
</div>
{新闻中的文章%}
{%endfor%}
它抓取“新闻”类型的文章,效果很好。现在我需要实现“加载更多”类型的寻呼机。因此,我应该在开始时显示,即5篇最新文章,并在下面吼叫“加载更多”按钮,单击时应加载另5篇,单击另5篇时应再次加载,以此类推,直到有新闻文章可用。我在sulu文档中没有看到提到“加载更多”功能
实现这一点的最佳方法是什么?我不久前创建了一个github gist,详细介绍了它的工作原理。 看