Generate title tags based on section content

@return string
187063
public function title()
    {
        // If no title has been set, try to figure it out based on breadcrumbs
        $title = View::yieldContent('title');
        if (empty($title)) {
            $title = app('decoy.breadcrumbs')->title();
        }

        // Set the title
        $site = $this->site();

        return '<title>' . ($title ? "$title | $site" : $site) . '</title>';
    }
645689
public function getTitle()
    {
        $fields = $this->_fields;

        if (array_key_exists('title', $fields)) {
            return (string) $fields['title'];
        }

        $fieldNames = $this->getTitleColumnNames($this->contenttype);

        $title = [];
        foreach ($fieldNames as $fieldName) {
            // Make sure we add strings only, as some fields may be an array or DateTime.
            if (array_key_exists($fieldName, $fields)) {
                $title[] = is_array($fields[$fieldName]) ? implode(' ', $fields[$fieldName]) : (string) $fields[$fieldName];
            }
        }

        return implode(' ', $title);
    }
829325
public function getTitle()
    {
        $t = $this->dom->getElementsByTagName('title')->item(0);
        if ($t == null) {
            return null;
        } else {
            return $t->nodeValue;
        }
    }
275870
protected function getTitle()
	{
		// Initialise variables.
		$title = '';

		if ($this->hidden)
		{

			return $title;
		}

		// Get the label text from the XML element, defaulting to the element name.
		$title = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];
		$title = $this->translateLabel ? Lang::txt($title) : $title;

		return $title;
	}
348314
def title(self) -> str:
        """"""
        title_element = _find_tag(self.head, 'title')
        if title_element:
            return title_element.textContent
        return ''
1312472
public function getTitle()
    {
        // configure the link
        $linkconf = $this->getResultLinkConfiguration();

        list($type) = explode(':', $this->row['type']);
        switch ($type) {
            case 'file':
                // if we use FAL, see if we have a title in the metadata
                if ($this->row['orig_uid'] && ($fileObject = SearchHelper::getFile($this->row['orig_uid']))) {
                    $metadata = $fileObject->_getMetaData();
                    $linktext = ($metadata['title'] ? $metadata['title'] : $this->row['title']);
                } else {
                    $linktext = $this->row['title'];
                }
                break;
            default:
                $linktext = $this->row['title'];
                break;
        }

        // clean title
        $linktext = htmlspecialchars(strip_tags($linktext));

        // highlight hits in result title?
        if ($this->conf['highlightSword'] && count($this->pObj->swords)) {
            $linktext = $this->highlightArrayOfWordsInContent($this->pObj->swords, $linktext);
        }
        return $this->cObj->typoLink($linktext, $linkconf);
    }
1207685
private static function getDisplayTitle( Title $title ) {
	    $pagetitle = $title->getPrefixedText();
	    // remove fragment
	    $title = Title::newFromText( $pagetitle );
	    
        $values = \PageProps::getInstance()->getProperties( $title, 'displaytitle' );
        $id = $title->getArticleID();
        if ( array_key_exists( $id, $values ) ) {
            $value = $values[$id];
            if ( trim( str_replace( '&#160;', '', strip_tags( $value ) ) ) !== '' ) {
                return $value;
            }
        }
        
        // no display title found
        return $title->getPrefixedText();
	}
1308047
protected function getTitleComment()
    {
        $titleComment = null;

        foreach ($this->getCommentSections() as $commentSection) {
            // Identify the title by the # markdown header syntax
            if (preg_match('/^\s*#/i', $commentSection)) {
                $titleComment = $commentSection;
                break;
            }
        }

        return $titleComment;
    }
473782
public function title() {
		if ( $rd = $this->get_revised_data_from_method('title') ) {
			return $rd;
		}
		return apply_filters('the_title', $this->post_title, $this->ID);
	}
1017115
public function getTitle()
    {
        $crawler = $this->getCrawler();

        $result = $crawler->filter('h1');
        if ($result->count()) {
            return $result->html();
        }
    }
769363
public function prepareTitle()
    {
        $title = $this->format;

        // replace the placeholders with actual data
        foreach (array_keys(self::$db) as $key) {
            $title = str_ireplace('%' . $key, $this->$key, $title);
        }

        return $title;
    }
416402
public function generate()
	{
		if (TL_MODE == 'FE' && !BE_USER_LOGGED_IN && ($this->invisible || ($this->start > 0 && $this->start > time()) || ($this->stop > 0 && $this->stop < time())))
		{
			return '';
		}

		if ($this->arrData['space'][0] != '')
		{
			$this->arrStyle[] = 'margin-top:'.$this->arrData['space'][0].'px;';
		}

		if ($this->arrData['space'][1] != '')
		{
			$this->arrStyle[] = 'margin-bottom:'.$this->arrData['space'][1].'px;';
		}

		$this->Template = new \FrontendTemplate($this->strTemplate);
		$this->Template->setData($this->arrData);

		$this->compile();

		$this->Template->style = !empty($this->arrStyle) ? implode(' ', $this->arrStyle) : '';
		$this->Template->class = trim('ce_' . $this->type . ' ' . $this->cssID[1]);
		$this->Template->cssID = ($this->cssID[0] != '') ? ' id="' . $this->cssID[0] . '"' : '';

		$this->Template->inColumn = $this->strColumn;

		if ($this->Template->headline == '')
		{
			$this->Template->headline = $this->headline;
		}

		if ($this->Template->hl == '')
		{
			$this->Template->hl = $this->hl;
		}

		return $this->Template->parse();
	}
1327620
public function getTitleField()
    {
        if ($this->title_field && $this->hasElement($this->title_field)) {
            return $this->title_field;
        }

        return $this->id_field;
    }
245390
private function get_sequence() {
        if (!empty($this->modinfo->sections[$this->_section])) {
            return implode(',', $this->modinfo->sections[$this->_section]);
        } else {
            return '';
        }
    }
1077519
public static function generate_html_id($title)
    {
        $t = $title;
        $t = str_replace('&amp;', '-and-', $t);
        $t = str_replace('&', '-and-', $t);
        $t = preg_replace('/[^A-Za-z0-9]+/', '-', $t);
        $t = preg_replace('/-+/', '-', $t);
        $t = trim($t, '-');
        $t = strtolower($t);

        return $t;
    }
1220387
public function GenerateTitle()
    {
        if ($this->owner->MetaTitle) {
            return $this->owner->MetaTitle;
        } else {
            return SiteConfig::current_site_config()->GenerateTitle($this->owner->Title);
        }
    }
1288084
public function get_template_titles() {

		static $template_titles;

		if ( empty( $template_titles ) ) {
			$all_templates = (array) pods_api()->load_templates( array() );

			$template_titles = array();

			foreach ( $all_templates as $template ) {
				$template_titles[] = $template['name'];
			}
		}

		return $template_titles;

	}