TYPO3-Headless / headless_news

Adds support for EXT:news to EXT:headless
MIT License
11 stars 18 forks source link

Pagination links #7

Closed PrzemyslawMatlega closed 2 years ago

PrzemyslawMatlega commented 4 years ago

Example: '/news' route provides data for the first page.

data: { pagination: { current: 1, numberOfPages: 2 }, list: [ { uid: 2, title: "News 2", teaser: "Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content.", isTopNews: false, crdate: "Jul 09 2020", tstamp: "Jul 09 2020", datetime: "Jul 09 2020", archive: "", author: { author: "John Doe", authorEmail: "" }, media: [ ], falRelatedFiles: [ ], categories: [ ], tags: [ ], metaData: { keywords: "", description: "", alternativeTitle: "" }, slug: "/news/detail?tx_news_pi1%5Baction%5D=detail&tx_news_pi1%5Bcontroller%5D=News&tx_news_pi1%5Bnews%5D=2&cHash=7989e35b6586bfada7b13f266e07f2af", pathSegment: "news-2" } ], settings: { orderBy: "datetime", orderDirection: "desc", templateLayout: "", action: "list" } }

but, '/news/2' or '/news-2' thorws me 404

How I can get news from the second page?

lukaszuznanski commented 4 years ago

We should create pagination slug to output

slowhand11 commented 3 years ago

You can set dynamicly: :to="'/page/'+page". Depends on your yaml config

gothadrummer commented 2 years ago

Hello and thank you very much for your work! So are there any routes / queries to add after /news to reach the other posts? Like for instance with the WordPress json API?

lukaszuznanski commented 2 years ago

Not really, it's just output like on standard fluid page.