Skip to content

Question about list view #37

Answered by TheCadien
danielkeho asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for late response.

To get a list of news on your website you can use the SmartContent component.
This works basically as described in the Sulu Docs. But here is an example.

Add such a block to your Template.xml.
`


<title lang="en">News</title>

        <params>
            <param name="provider" value="news"/>
            <param name="max_per_page" value="5"/>
            <param name="page_parameter" value="p"/>
  </params>
`

You will get an array with news.
which you can go through with a For loop in twig.
You can also find an example of a twig integration in the docs

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TheCadien
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants