private function getListingParameters($contentTypeSlug, $allowViewless = false)
    {
        $contentType = $this->getContentType(current(explode('/', $contentTypeSlug)));

        // If there is no ContentType, don't get parameters for it
        if ($contentType === false) {
            return [];
        }

        // If the ContentType is 'viewless', don't show the listing / record page.
        if ($contentType['viewless'] && !$allowViewless) {
            $this->abort(Response::HTTP_NOT_FOUND, 'Page ' . $contentType['slug'] . ' not found.');
        }

        // Build the pager
        $page = $this->app['pager']->getCurrentPage($contentType['slug']);
        $order = isset($contentType['listing_sort']) ? $contentType['listing_sort'] : $this->getListingOrder($contentType);

        // CT value takes precedence over theme & config.yml
        if (!empty($contentType['listing_records'])) {
            $amount = $contentType['listing_records'];
        } else {
            $amount = $this->getOption('theme/listing_records') ?: $this->getOption('general/listing_records');
        }

        return ['limit' => $amount, 'order' => $order, 'page' => $page, 'paging' => true];
    }
private function getListingParameters($contentTypeSlug, $allowViewless = false)
    {
        $contentType = $this->getContentType(current(explode('/', $contentTypeSlug)));

        // If there is no ContentType, don't get parameters for it
        if ($contentType === false) {
            return [];
        }

        // If the ContentType is 'viewless', don't show the listing / record page.
        if ($contentType['viewless'] && !$allowViewless) {
            $this->abort(Response::HTTP_NOT_FOUND, 'Page ' . $contentType['slug'] . ' not found.');
        }

        // Build the pager
        $page = $this->app['pager']->getCurrentPage($contentType['slug']);
        $order = isset($contentType['listing_sort']) ? $contentType['listing_sort'] : $this->getListingOrder($contentType);

        // CT value takes precedence over theme & config.yml
        if (!empty($contentType['listing_records'])) {
            $amount = $contentType['listing_records'];
        } else {
            $amount = $this->getOption('theme/listing_records') ?: $this->getOption('general/listing_records');
        }

        return ['limit' => $amount, 'order' => $order, 'page' => $page, 'paging' => true];
    }
private function getListingParameters ( $ contentTypeSlug , $ allowViewless = false ) { $ contentType = $ this -> getContentType ( current ( explode ( '/' , $ contentTypeSlug ) ) ) ; // If there is no ContentType, don't get parameters for it if ( $ contentType === false ) { return [ ] ; } // If the ContentType is 'viewless', don't show the listing / record page. if ( $ contentType [ 'viewless' ] && ! $ allowViewless ) { $ this -> abort ( Response :: HTTP_NOT_FOUND , 'Page ' . $ contentType [ 'slug' ] . ' not found.' ) ; } // Build the pager $ page = $ this -> app [ 'pager' ] -> getCurrentPage ( $ contentType [ 'slug' ] ) ; $ order = isset ( $ contentType [ 'listing_sort' ] ) ? $ contentType [ 'listing_sort' ] : $ this -> getListingOrder ( $ contentType ) ; // CT value takes precedence over theme & config.yml if ( ! empty ( $ contentType [ 'listing_records' ] ) ) { $ amount = $ contentType [ 'listing_records' ] ; } else { $ amount = $ this -> getOption ( 'theme/listing_records' ) ? : $ this -> getOption ( 'general/listing_records' ) ; } return [ 'limit' => $ amount , 'order' => $ order , 'page' => $ page , 'paging' => true ] ; }
Returns an array of the parameters used in getContent for listing pages.

@param string $contentTypeSlug The content type slug
@param bool   $allowViewless   Allow viewless contenttype

@return array Parameters to use in getContent
Returns an array of the parameters used in getContent for listing pages .