S
S
Sergey Ivchenko2015-11-02 18:38:19
MODX
Sergey Ivchenko, 2015-11-02 18:38:19

How to set up Ditto pagination when writing an external module?

I write this nonsense:

//Выведем элементы
      $params = Array(
        'showPublishedOnly' => 0,
        'parents' => $result['CURRENT_FOLDER_ID'],
        'tpl' => '@CODE:' . $tpl,
        'paginate' => 1
      );
      echo $res = $modx->runSnippet('ditto', $params);

If the paginate parameter = 0 , then there are results, if it is 1, then an error is thrown:
`` is not numeric and may not be passed to makeUrl()
It is clear from the code that ditto cannot get the current document identifier, which is not surprising, because that the module is written as external and connected via include_once. How can this gap be resolved?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question