Jump to content

Pagination in profile - Unexpected token < in JSON

Recommended Posts

I have a problem with pagination in user profiles (Tabs).

I create an application:

  1. I'll add a Profile named ProfileClassname.php in Extensions
  2. Its contents have not been changed, except for the render function to:
    	 * Display
    	 * @return	string
    	public function render()
    		$table = new \IPS\Helpers\Table\Content('IPS\testpagination\TestPagination', $this->member->url()->setQueryString(array('tab' => 'node_testpagination_Profile')));
    		$table->rowsTemplate = array(\IPS\Theme::i()->getTemplate('profile', 'testpagination', 'front'), 'testpaginationRow');
    		$table->limit = 2;
    		$table->noModerate = TRUE;
    		return (string) $table;


  3. I have created a testpaginationRow.phtml file with the contents:
    <ips:template parameters="$table, $headers, $rows" />
    {{foreach $rows as $row}}
  4. IPS\testpagination\TestPagination class content:
    namespace IPS\testpagination;
    /* To prevent PHP errors (extending class does not exist) revealing path */
    if (!\defined('\IPS\SUITE_UNIQUE_KEY')) {
      header((isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0') . ' 403 Forbidden');
    class _TestPagination extends \IPS\Content\Item
       * @brief	Database Table
      public static $databaseTable = 'testpagination_members';
       * @brief	Application
      public static $application = 'testpagination';
       * @brief	Database Prefix
      public static $databasePrefix = 'testpagination_';
       * @brief	Database Column Map
      public static $databaseColumnMap = array(
        'date'      => 'date'


The effect is what I wanted:


But when I change the page, nothing happens and console in the browser shows me an error:

Ajax request failed (parsererror): SyntaxError: Unexpected token < in JSON at position 0



Here is test application:
test pagination 1.0.0 (1).tar


Link to comment
Share on other sites


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy