setPageTitle() public method

Set the page title
public setPageTitle ( string $value, boolean $overwrite = false )
$value string The page title to be set or to be prepended.
$overwrite boolean Should the existing page title be overwritten?
コード例 #1
0
ファイル: Page.php プロジェクト: arashrasoulzadeh/forkcms
 /**
  * Processes the page
  */
 protected function processPage()
 {
     // set pageTitle
     $this->header->setPageTitle($this->record['meta_title'], (bool) ($this->record['meta_title_overwrite'] == 'Y'));
     // set meta-data
     $this->header->addMetaDescription($this->record['meta_description'], (bool) ($this->record['meta_description_overwrite'] == 'Y'));
     $this->header->addMetaKeywords($this->record['meta_keywords'], $this->record['meta_keywords_overwrite'] == 'Y');
     $this->header->setMetaCustom($this->record['meta_custom']);
     // advanced SEO-attributes
     if (isset($this->record['meta_data']['seo_index'])) {
         $this->header->addMetaData(array('name' => 'robots', 'content' => $this->record['meta_data']['seo_index']));
     }
     if (isset($this->record['meta_data']['seo_follow'])) {
         $this->header->addMetaData(array('name' => 'robots', 'content' => $this->record['meta_data']['seo_follow']));
     }
     // create navigation instance
     new Navigation($this->getKernel());
     // assign content
     $pageInfo = Navigation::getPageInfo($this->record['id']);
     $this->record['has_children'] = $pageInfo['has_children'];
     $this->tpl->assign('page', $this->record);
     // set template path
     $this->templatePath = FRONTEND_PATH . '/' . $this->record['template_path'];
     // loop blocks
     foreach ($this->record['positions'] as $position => &$blocks) {
         // position not known in template = skip it
         if (!in_array($position, $this->record['template_data']['names'])) {
             continue;
         }
         // loop blocks in position
         foreach ($blocks as $index => &$block) {
             // an extra
             if ($block['extra_id'] !== null) {
                 // block
                 if ($block['extra_type'] == 'block') {
                     // create new instance
                     $extra = new FrontendBlockExtra($this->getKernel(), $block['extra_module'], $block['extra_action'], $block['extra_data']);
                     if (extension_loaded('newrelic')) {
                         newrelic_name_transaction($block['extra_module'] . '::' . $block['extra_action']);
                     }
                 } else {
                     // widget
                     $extra = new FrontendBlockWidget($this->getKernel(), $block['extra_module'], $block['extra_action'], $block['extra_data']);
                 }
                 // add to list of extras
                 $block = array('extra' => $extra);
                 // add to list of extras to parse
                 $this->extras[] = $extra;
             } else {
                 // the block only contains HTML
                 $block = array('blockIsEditor' => true, 'blockContent' => $block['html']);
                 // Maintain backwards compatibility
                 $block['blockIsHTML'] = $block['blockIsEditor'];
             }
         }
     }
 }
コード例 #2
0
ファイル: Block.php プロジェクト: forkcms/forkcms
 /**
  * @param Meta $meta
  */
 protected function setMeta(Meta $meta)
 {
     $this->header->setPageTitle($meta->getTitle(), $meta->isTitleOverwrite());
     $this->header->addMetaDescription($meta->getDescription(), $meta->isDescriptionOverwrite());
     $this->header->addMetaKeywords($meta->getKeywords(), $meta->isKeywordsOverwrite());
     if ($meta->hasSEOFollow()) {
         $this->header->addMetaData(['name' => 'robots', 'content' => $meta->getSEOFollow()]);
     }
     if ($meta->hasSEOIndex()) {
         $this->header->addMetaData(['name' => 'robots', 'content' => $meta->getSEOIndex()]);
     }
 }