code: private function setTitleAndDescription()
      {
          $page = $this->getPage();
          if ($page && $this->objItems->getCount()) {
              // Add title if needed.
              if (!empty($this->strTitleAttribute)) {
                  while ($this->objItems->next()) {
                      /** @var IItem $objCurrentItem */
                      $objCurrentItem = $this->objItems->current();
                      $arrTitle       = $objCurrentItem->parseAttribute(
                          $this->strTitleAttribute,
                          'text',
                          $this->getView()
                      );
  
                      if (!empty($arrTitle['text'])) {
                          $page->pageTitle = strip_tags($arrTitle['text']);
                          break;
                      }
                  }
  
                  $this->objItems->reset();
              }
  
              // Add description if needed.
              if (!empty($this->strDescriptionAttribute)) {
                  while ($this->objItems->next()) {
                      $objCurrentItem = $this->objItems->current();
                      $arrDescription = $objCurrentItem->parseAttribute(
                          $this->strDescriptionAttribute,
                          'text',
                          $this->getView()
                      );
  
                      if (!empty($arrDescription['text'])) {
                          $page->description = StringUtil::substr($arrDescription['text'], 160);
                          break;
                      }
                  }
  
                  $this->objItems->reset();
              }
          }
      }
docs: Set the title and description in the page object.
  
  @return void