code: public function generate()
  	{
  		$objArticle = ArticleModel::findPublishedById($this->article);
  
  		if ($objArticle === null)
  		{
  			return '';
  		}
  
  		// Use findPublished() instead of getRelated()
  		$objParent = PageModel::findPublishedById($objArticle->pid);
  
  		if ($objParent === null)
  		{
  			return '';
  		}
  
  		$this->objArticle = $objArticle;
  		$this->objParent = $objParent;
  
  		return parent::generate();
  	}
docs: Check whether the target page and the article are published
  
  @return string