Score:0

How to make pagination for php data inside preprocess_paragraph_HOOK

ru flag

I have data coming from External Entity (MongoDB) and I need to make pagination inside hook theme suggestion of a paragraph :

code snippet

Is there a way to use built-in pagination of Drupal in this scenario? thanks!

leymannx avatar
ne flag
`$build['pager'] = ['#type' => 'pager'];`. https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21Pager.php/class/Pager. Scan the core folder for samples.
leymannx avatar
ne flag
Does this answer your question? [How to add Pager to a custom page?](https://drupal.stackexchange.com/questions/206169/how-to-add-pager-to-a-custom-page)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.