Select a template for taxonomy.

@param string $taxonomyslug

@return string[]
972065
public function taxonomy($taxonomyslug)
    {
        $templates = [];

        // First candidate: defined specifically in the taxonomy
        if ($template = $this->config->get('taxonomy/' . $taxonomyslug . '/listing_template')) {
            $templates[] = $template;
        }

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

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

        return $templates;
    }
632233
public function getTemplates()
	{
		$templates = [
			'br' => '<br/>',
			'e'  => '',
			'i'  => '',
			'p'  => '<p><xsl:apply-templates/></p>',
			's'  => ''
		];

		foreach ($this->configurator->tags as $tagName => $tag)
		{
			if (isset($tag->template))
			{
				$templates[$tagName] = (string) $tag->template;
			}
		}

		ksort($templates);

		return $templates;
	}
1086680
protected function getContentBySlug($slug) {
        $this->CmsContent = TableRegistry::get('CmsContent');
        $query = $this->CmsContent->find('all');
        $query->where(['name' => $slug]);
        $data = $query->first();
        return $data;
    }
1014926
public static function getCoreTemplates($extension = false)
    {
        $paths = apply_filters('Modularity/CoreTemplatesSearchPaths', array(
            get_stylesheet_directory(),
            get_template_directory()
        ));

        $fileExt = apply_filters('Modularity/CoreTemplatesSearchFileExtension', array(
            '.php',
            '.blade.php'
        ));

        $search = apply_filters(
            'Modularity/CoreTemplatesSearchTemplates',
            array(
                'index',
                'comments',
                'front-page',
                'home',
                'single',
                'single-*',
                'archive',
                'archive-*',
                'page',
                'page-*',
                'category',
                'category-*',
                'author',
                'date',
                'search',
                'attachment',
                'image'
            )
        );

        $templates = array();

        foreach ($paths as $path) {
            foreach ($search as $pattern) {
                foreach ($fileExt as $ext) {
                    $foundTemplates = array();
                    foreach (glob($path . '/' . $pattern . $ext) as $found) {
                        $basename = str_replace(array('.blade.php', '.php'), '', basename($found));

                        if ($extension) {
                            $foundTemplates[$basename] = basename($found);
                        } else {
                            $foundTemplates[$basename] = str_replace(array('.blade.php', '.php'), '', basename($found));
                        }
                    }

                    $templates = array_merge($templates, $foundTemplates);
                }
            }
        }

        $templates = array_unique($templates);

        return $templates;
    }
289553
public function getRouteParameters($taxonomy)
    {
        $taxonomy = Taxonomy::taxonomy($taxonomy)
                            ->term($this->name)
                            ->with('parent')
                            ->first();

        $parameters = $this->getParentSlugs($taxonomy);

        array_push($parameters, $taxonomy->taxonomy);

        return array_reverse($parameters);
    }
807845
public function getDocumentBySlug($slug)
    {
        $search = $this->repository->createSearch();
        $search->addQuery(new TermQuery('slug', $slug), 'must');

        $results = $this->repository->execute($search);

        if (count($results) === 0) {
            $this->logger && $this->logger->warning(
                sprintf("Can not render snippet for '%s' because content was not found.", $slug)
            );

            return null;
        }

        return $results->current();
    }
984142
public function getAvailableTemplateLayouts($pageUid)
    {
        $templateLayouts = [];

        // Check if the layouts are extended by ext_tables
        if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['dvoconnector']['templateLayouts'])
            && is_array($GLOBALS['TYPO3_CONF_VARS']['EXT']['dvoconnector']['templateLayouts'])
        ) {
            $templateLayouts = $GLOBALS['TYPO3_CONF_VARS']['EXT']['dvoconnector']['templateLayouts'];
        }

        // Add TsConfig values
        foreach ($this->getTemplateLayoutsFromTsConfig($pageUid) as $templateKey => $title) {
            if (GeneralUtility::isFirstPartOfStr($title, '--div--')) {
                $optGroupParts = GeneralUtility::trimExplode(',', $title, true, 2);
                $title = $optGroupParts[1];
                $templateKey = $optGroupParts[0];
            }
            $templateLayouts[] = [$title, $templateKey];
        }

        return $templateLayouts;
    }
477382
public function getContentsBySlugsFunction($slugs, $keepOrder = false)
    {
        $search = $this->repository->createSearch();
        $search->addQuery(new TermsQuery('slug', $slugs), 'should');

        $result = $this->repository->execute($search);

        if ($keepOrder) {
            $orderedResult = [];
            foreach ($slugs as $slug) {
                foreach ($result as $document) {
                    if ($document->slug == $slug) {
                        $orderedResult[] = $document;
                    }
                }
            }

            $result = $orderedResult;
        }

        return $result;
    }
487942
public function findBySlug($slug)
    {
        return $this->slugWorkingRecord->get()->filter($this->slugDbField, $slug)->first();
    }
767170
protected function getPageTemplates()
    {
        $choices = [];

        $templates = $this->getContainer()->getParameter('networking_init_cms.page.templates');
        foreach ($templates as $key => $template) {
            $choices[$template['name']] = $key;
        }

        return $choices;
    }
309315
public static function selectTemplateList(
        $templateState
    ) {
        $templateState = (object) $templateState;

        $templateList = [];
        foreach ($templateState->template as $templateKey => $templateItem) {
            $templateList[$templateKey] = $templateItem;
        }

        return $templateList;
    }
1281902
public function templates()
    {
        try {
            $directory = $this->getTemplateDir();
            $files = File::files($directory);
        } catch (Exception $e) {
            $files = File::files(base_path('vendor/typicms/pages/src/resources/views/public'));
        }
        $templates = [];
        foreach ($files as $file) {
            $filename = File::name($file);
            if ($filename === 'default.blade') {
                continue;
            }
            $name = str_replace('.blade', '', $filename);
            if ($name[0] != '_' && $name != 'master') {
                $templates[$name] = ucfirst($name);
            }
        }

        return ['' => 'Default'] + $templates;
    }
10077
public function getTemplates()
    {
        $templates = array();

        if ($handle = opendir(Primer::$PATTERN_PATH . '/templates')) {
            while (false !== ($entry = readdir($handle))) {
                if (substr($entry, 0, 1) !== '.') {
                    $templates[] = array(
                        'id' => $entry,
                        'title' => preg_replace('/[^A-Za-z0-9]/', ' ', $entry),
                    );
                }
            }

            closedir($handle);
        }

        return $templates;
    }
1138994
protected function getAllSlugs()
    {
        $pluggables = $this->all();
        $slugs = [];
        foreach ($pluggables as $plug) {
            $slugs[] = $plug['slug'];
        }

        return $slugs;
    }
477782
public static function findByPostType($postTypeSlug)
    {
        $postType = PostType::findBySlug($postTypeSlug);
        if($postType) {
            return self::where('postTypeID', $postType->postTypeID)->get();
        }
        return;
    }
176870
public function getUserBySlug($slug)
    {
        $return = array();

        $users = $this->repository->users;
        foreach ($users as $user) {
            if ($user->slug == $slug) {
                $return = $user;
                break;
            }
        }

        return $return;
    }
503883
protected function getSelectedCategory($categorySlug = null)
    {
        $selectedCategory = null;

        if ($categorySlug !== null) {
            $selectedCategory = $this->getCategoryRepository()->findOneBy(array('isActive' => true, 'slug' => $categorySlug));
        }

        return $selectedCategory;
    }