src/Gzero/Cms/ViewModels/ContentViewModel.php
public function seoTitle($alternativeField = false)
    {
        if (!$alternativeField) {
            $alternativeField = config('gzero-cms.seo.alternative_title', 'title');
        }

        $text = $this->removeNewLinesAndWhitespace($this->translation[$alternativeField]);
        // if alternative field is not empty
        if ($text) {
            return $this->translation['seo_title'] ? $this->removeNewLinesAndWhitespace($this->translation['seo_title']) : $text;
        }
        // show site name as default
        return option('general', 'site_name');
    }
public function seoTitle($alternativeField = false)
    {
        if (!$alternativeField) {
            $alternativeField = config('gzero-cms.seo.alternative_title', 'title');
        }

        $text = $this->removeNewLinesAndWhitespace($this->translation[$alternativeField]);
        // if alternative field is not empty
        if ($text) {
            return $this->translation['seo_title'] ? $this->removeNewLinesAndWhitespace($this->translation['seo_title']) : $text;
        }
        // show site name as default
        return option('general', 'site_name');
    }
public function seoTitle ( $ alternativeField = false ) { if ( ! $ alternativeField ) { $ alternativeField = config ( 'gzero-cms.seo.alternative_title' , 'title' ) ; } $ text = $ this -> removeNewLinesAndWhitespace ( $ this -> translation [ $ alternativeField ] ) ; // if alternative field is not empty if ( $ text ) { return $ this -> translation [ 'seo_title' ] ? $ this -> removeNewLinesAndWhitespace ( $ this -> translation [ 'seo_title' ] ) : $ text ; } // show site name as default return option ( 'general' , 'site_name' ) ; }
Return seoTitle of translation if exists
otherwise return generated one

@param mixed $alternativeField alternative field to display when seoTitle field is empty

@return string
Return seoTitle of translation if exists otherwise return generated one