0

I need to change the comments per page value, I set it 50 from the field setting but in some pages, I need showing only 10 comments, not 50. I tried to use this method

setSettings([
    'per_page' => '10',
  ]);  

it chnaged vlaue but sitll page showing 50 resultes.
Code.

function my_module_preprocess_paragraph(&$variables) {
  $paragraph = $variables['paragraph'];
  $def = $paragraph->getFieldDefinitions();
  $def['field_name']->setSettings(['per_page' => '5',]);
}
  • Where did you use setSettings([ 'per_page' => '10', ]); can you post your code ? – berramou Apr 25 at 9:08
  • ' function my_module_preprocess_paragraph(&$variables) { $paragraph = $variables['paragraph']; $def = $paragraph->getFieldDefinitions(); $def['field_name']->setSettings([ 'per_page' => '5', ]); ' – M.G Apr 25 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.