public function listing($contenttype)
    {
        $templates = [];

        // First candidate: defined specifically in the contenttype.
        if (!empty($contenttype['listing_template'])) {
            $templates[] = $contenttype['listing_template'];
        }

        // Second candidate: a template with the same filename as the name of
        // the contenttype.
        $templates[] = $contenttype['slug'] . '.twig';

        // Third candidate: Theme-specific config.yml file.
        if ($template = $this->config->get('theme/listing_template')) {
            $templates[] = $template;
        }

        // Fourth candidate: Global config.yml
        $templates[] = $this->config->get('general/listing_template');

        // Fifth candidate: fallback to 'listing.twig'
        $templates[] = 'listing.twig';

        return $templates;
    }
public function listing($contenttype)
    {
        $templates = [];

        // First candidate: defined specifically in the contenttype.
        if (!empty($contenttype['listing_template'])) {
            $templates[] = $contenttype['listing_template'];
        }

        // Second candidate: a template with the same filename as the name of
        // the contenttype.
        $templates[] = $contenttype['slug'] . '.twig';

        // Third candidate: Theme-specific config.yml file.
        if ($template = $this->config->get('theme/listing_template')) {
            $templates[] = $template;
        }

        // Fourth candidate: Global config.yml
        $templates[] = $this->config->get('general/listing_template');

        // Fifth candidate: fallback to 'listing.twig'
        $templates[] = 'listing.twig';

        return $templates;
    }
public function listing ( $ contenttype ) { $ templates = [ ] ; // First candidate: defined specifically in the contenttype. if ( ! empty ( $ contenttype [ 'listing_template' ] ) ) { $ templates [ ] = $ contenttype [ 'listing_template' ] ; } // Second candidate: a template with the same filename as the name of // the contenttype. $ templates [ ] = $ contenttype [ 'slug' ] . '.twig' ; // Third candidate: Theme-specific config.yml file. if ( $ template = $ this -> config -> get ( 'theme/listing_template' ) ) { $ templates [ ] = $ template ; } // Fourth candidate: Global config.yml $ templates [ ] = $ this -> config -> get ( 'general/listing_template' ) ; // Fifth candidate: fallback to 'listing.twig' $ templates [ ] = 'listing.twig' ; return $ templates ; }
Select a template for listing pages.

@param array $contenttype

@return string[]
Select a template for listing pages .