public function homepage($content)
    {
        $templates = [];

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

        // Second candidate: Global config.yml file.
        if ($template = $this->config->get('general/homepage_template')) {
            $templates[] = $template;
        }

        if (empty($content)) {
            // Fallback if no content: index.twig
            $templates[] = 'index.twig';
        } elseif (is_array($content)) {
            // Fallback with multiple content: use listing() to choose template
            $first = reset($content);
            $templates = array_merge($templates, $this->listing($first->contenttype));
        } else {
            // Fallback with single content: use record() to choose template
            $templates = array_merge($templates, $this->record($content));
        }

        return $templates;
    }
public function homepage($content)
    {
        $templates = [];

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

        // Second candidate: Global config.yml file.
        if ($template = $this->config->get('general/homepage_template')) {
            $templates[] = $template;
        }

        if (empty($content)) {
            // Fallback if no content: index.twig
            $templates[] = 'index.twig';
        } elseif (is_array($content)) {
            // Fallback with multiple content: use listing() to choose template
            $first = reset($content);
            $templates = array_merge($templates, $this->listing($first->contenttype));
        } else {
            // Fallback with single content: use record() to choose template
            $templates = array_merge($templates, $this->record($content));
        }

        return $templates;
    }
public function homepage ( $ content ) { $ templates = [ ] ; // First candidate: Theme-specific config.yml file. if ( $ template = $ this -> config -> get ( 'theme/homepage_template' ) ) { $ templates [ ] = $ template ; } // Second candidate: Global config.yml file. if ( $ template = $ this -> config -> get ( 'general/homepage_template' ) ) { $ templates [ ] = $ template ; } if ( empty ( $ content ) ) { // Fallback if no content: index.twig $ templates [ ] = 'index.twig' ; } elseif ( is_array ( $ content ) ) { // Fallback with multiple content: use listing() to choose template $ first = reset ( $ content ) ; $ templates = array_merge ( $ templates , $ this -> listing ( $ first -> contenttype ) ) ; } else { // Fallback with single content: use record() to choose template $ templates = array_merge ( $ templates , $ this -> record ( $ content ) ) ; } return $ templates ; }
Choose a template for the homepage.

@param \Bolt\Legacy\Content|\Bolt\Legacy\Content[] $content

@return string[]
Choose a template for the homepage .